如何改变每个节点的内存为Apache火花工人 [英] How to change memory per node for apache spark worker

查看:229
本文介绍了如何改变每个节点的内存为Apache火花工人的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我配置一个Apache星火集群。

I am configuring an Apache Spark cluster.

当我运行1主3奴隶集群,我看这方面的大师监视页:

When I run the cluster with 1 master and 3 slaves, I see this on the master monitor page:

Memory
2.0 GB (512.0 MB Used)
2.0 GB (512.0 MB Used)
6.0 GB (512.0 MB Used)

我要增加对工人所使用的内存,但我无法找到这个合适的配置。我已经改变了 spark-env.sh 如下:

export SPARK_WORKER_MEMORY=6g
export SPARK_MEM=6g
export SPARK_DAEMON_MEMORY=6g
export SPARK_JAVA_OPTS="-Dspark.executor.memory=6g"
export JAVA_OPTS="-Xms6G -Xmx6G"

但使用的内存仍然是相同的。我应该怎么做来改变使用的内存?

But the used memory is still the same. What should I do to change used memory?

推荐答案

在使用1.0.0+并使用火花壳或无火花提交,使用 - 执行人内存选项。例如。

When using 1.0.0+ and using spark-shell or spark-submit, use the --executor-memory option. E.g.

spark-shell --executor-memory 8G ...

0.9.0以下:

当您开始工作或启动外壳更换内存。我们不得不修改火花shell脚本,以便它通过执行命令行参数作为基础的Java应用程序参数。特别是:

When you start a job or start the shell change the memory. We had to modify the spark-shell script so that it would carry command line arguments through as arguments for the underlying java application. In particular:

OPTIONS="$@"
...
$FWDIR/bin/spark-class $OPTIONS org.apache.spark.repl.Main "$@"

然后,我们可以按照如下运行我们的火花外壳:

Then we can run our spark shell as follows:

spark-shell -Dspark.executor.memory=6g

当将其配置为一个独立的罐子,我创造的火花上下文并传递值作为命令行参数之前编程设置系统属性(我可以把它比长篇大论系统道具再短)。

When configuring it for a standalone jar, I set the system property programmatically before creating the spark context and pass the value in as a command line argument (I can make it shorter than the long winded system props then).

System.setProperty("spark.executor.memory", valueFromCommandLine)

至于改变默认的簇宽,对不起,不能完全确定如何正确地做到这一点。

As for changing the default cluster wide, sorry, not entirely sure how to do it properly.

最后一点 - 我对你有2GB 2节点和一个与6GB其实有点担心。您可以使用的内存将被限制在最小的节点 - 所以这里2GB

One final point - I'm a little worried by the fact you have 2 nodes with 2GB and one with 6GB. The memory you can use will be limited to the smallest node - so here 2GB.

这篇关于如何改变每个节点的内存为Apache火花工人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆