我可以真正设置多少个核心到Apache Spark独立集群?

时间:2016-06-04 14:29:08

标签: apache-spark worker apache-spark-standalone

我在一台计算机上安装了Apache Spark 1.6.1独立集群,其规格如下:

  • CPU:Core i7-4790(核心数:4,线程数:8)
  • RAM:16GB

我在conf / spark-env.sh

中使用以下设置
export SPARK_WORKER_MEMORY 
export SPARK_WORKER_INSTANCES 
export SPARK_WORKER_CORES
export SPARK_WORKER_DIR

由于机器有一个4芯处理器,我认为可能的配置可能是:

export SPARK_WORKER_MEMORY = 14g
export SPARK_WORKER_INSTANCES = 1
export SPARK_WORKER_CORES = 1
export SPARK_WORKER_DIR =/local_drive/sparkdata

export SPARK_WORKER_MEMORY = 14g
export SPARK_WORKER_INSTANCES = 1
export SPARK_WORKER_CORES = 2
export SPARK_WORKER_DIR =/local_drive/sparkdata

export SPARK_WORKER_MEMORY = 14g
export SPARK_WORKER_INSTANCES = 1
export SPARK_WORKER_CORES = 3
export SPARK_WORKER_DIR =/local_drive/sparkdata

export SPARK_WORKER_MEMORY = 14g
export SPARK_WORKER_INSTANCES = 1
export SPARK_WORKER_CORES = 4
export SPARK_WORKER_DIR =/local_drive/sparkdata

export SPARK_WORKER_MEMORY = 7g
export SPARK_WORKER_INSTANCES = 2
export SPARK_WORKER_CORES = 1
export SPARK_WORKER_DIR =/local_drive/sparkdata

export SPARK_WORKER_MEMORY = 7g
export SPARK_WORKER_INSTANCES = 2
export SPARK_WORKER_CORES = 2
export SPARK_WORKER_DIR =/local_drive/sparkdata

export SPARK_WORKER_MEMORY = 4.5g
export SPARK_WORKER_INSTANCES = 3
export SPARK_WORKER_CORES = 1
export SPARK_WORKER_DIR =/local_drive/sparkdata

export SPARK_WORKER_MEMORY = 3.5g
export SPARK_WORKER_INSTANCES = 4
export SPARK_WORKER_CORES = 1
export SPARK_WORKER_DIR =/local_drive/sparkdata

所以我的想法是:

  • 内存必须在工作人员实例数之间划分,
  • 每个工作者实例的工作核心数量相乘,因此,我不能拥有4个工作器实例和2个工作核心,因为我没有8个核心。

问题是我测试了配置,并设置:

export SPARK_WORKER_MEMORY = 14g
export SPARK_WORKER_INSTANCES = 3
export SPARK_WORKER_CORES = 40
export SPARK_WORKER_DIR =/local_drive/sparkdata

我收到任何错误,再加上Apache Web界面显示“40核心”。怎么了?那么我真的可以拥有多少个工人核心和工人实例?

提前致谢。

0 个答案:

没有答案