【发布时间】:2020-01-25 09:32:43
【问题描述】:
我有一个脚本 (script1.sh),它运行一个接收两个参数 a 和 b 的 spark 作业。 如果我将参数更改为 c 和 d ,相同的脚本会访问不同的资源。 此脚本用于在 spark 集群上运行作业。
目前该作业在两个不同的时间运行,第一个是上午 10:00,第二个是上午 11:00:
$ sh -x script1.sh a b
$ sh -x script1.sh c d
我知道我们可以同时运行多个脚本:
$ sh -x script1.sh & sh -x script2.sh & sh -x script3.sh
但我没有多个脚本。
我现在不太关心性能
对我来说同时运行两个模块最有效的方法是什么? 我可以吗:
$ sh -x script1.sh a b & sh -x script1.sh c d
有没有更有效的方法?我需要在这里改变什么吗? 这些是当前的规格:
--driver-memory 15G \
--driver-cores 5 \
--num-executors 30 \
--executor-memory 20G \
--executor-cores 5 \
P.S:我宁愿不编辑 shell 脚本。
【问题讨论】:
-
我用了这个 $ sh -x script1.sh a b & sh -x script1.sh c d,第二个作业失败了
-
sh -x script1.sh a b & sh -x script1.sh c d应该可以工作,除非脚本使用了一些不能同时访问的资源。失败的错误信息是什么? -
@qan99 ,您收到的错误信息是什么??
-
如果同时执行失败,则运行
sh -x script1.sh a b && sh -x script1.sh c d -
谢谢。该错误是因为我试图通过应用程序无法访问的不同模块访问某些内容。当我尝试使用不同的模块时它起作用了。
标签: linux scala shell apache-spark apache-spark-sql