星火配置:SPARK_MEM与SPARK_WORKER_MEMORY [英] Spark Configuration: SPARK_MEM vs. SPARK_WORKER_MEMORY

查看:444
本文介绍了星火配置:SPARK_MEM与SPARK_WORKER_MEMORY的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在spark-env.sh,它可以配置以下环境变量:

 # -  SPARK_WORKER_MEMORY,要设置多少内存使用(例如1000米2G)
出口SPARK_WORKER_MEMORY =22克
[...]
# - SPARK_MEM,改变每个节点使用的内存量(这应该
#在相同的格式JVM的-Xmx选项,例如300米或1G)
出口SPARK_MEM =3克

如果我开始一个独立的集群这样的:

  $ SPARK_HOME /斌/ start-all.sh

我可以在主星火UI网页,所有的工人只有3GB RAM开始看

   - 工存储器列 - 
22.0 GB(3.0 GB使用)
22.0 GB(3.0 GB使用)
22.0 GB(3.0 GB使用)
[...]

不过,我指定22克为SPARK_WORKER_MEMORY在spark-env.sh

我这个有些困惑。也许我不明白,节点和工人之间的区别。

有人可以解释两个内存设置,我可能做错了什么不同?

我使用的火花0.7.0。另请参见这里更多的配置信息。


解决方案

一个独立的集群可以承载多个星火集群(每个簇是依赖于特定的SparkContext)。也就是说,您可以有一个集群中运行的Kmeans,一个集群运行的鲨鱼,而另一个运行一些互动的数据挖掘。

在这种情况下,22GB是你分配给火花独立簇的存储器的总量,和SparkContext的特定实例,每个节点使用3GB。所以,你可以创建一个使用多达21GB 6个SparkContext的。

In spark-env.sh, it's possible to configure the following environment variables:

# - SPARK_WORKER_MEMORY, to set how much memory to use (e.g. 1000m, 2g)
export SPARK_WORKER_MEMORY=22g
[...]
# - SPARK_MEM, to change the amount of memory used per node (this should
#   be in the same format as the JVM's -Xmx option, e.g. 300m or 1g)
export SPARK_MEM=3g

If I start a standalone cluster with this:

$SPARK_HOME/bin/start-all.sh

I can see at the Spark Master UI webpage that all the workers start with only 3GB RAM:

-- Workers Memory Column --
22.0 GB (3.0 GB Used)
22.0 GB (3.0 GB Used)
22.0 GB (3.0 GB Used)
[...]

However, I specified 22g as SPARK_WORKER_MEMORY in spark-env.sh

I'm somewhat confused by this. Probably I don't understand the difference between "node" and "worker".

Can someone explain the difference between the two memory settings and what I might have done wrong?

I'm using spark-0.7.0. See also here for more configuration info.

解决方案

A standalone cluster can host multiple Spark clusters (each "cluster" is tied to a particular SparkContext). i.e. you can have one cluster running kmeans, one cluster running Shark, and another one running some interactive data mining.

In this case, the 22GB is the total amount of memory you allocated to the Spark standalone cluster, and your particular instance of SparkContext is using 3GB per node. So you can create 6 more SparkContext's using up to 21GB.

这篇关于星火配置:SPARK_MEM与SPARK_WORKER_MEMORY的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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