在YARN上运行Spark-Submit但是不平衡(只有1个节点正在运行)

anu*_*der 5 hadoop cluster-computing hadoop-yarn apache-spark

我尝试在YARN-CLUSTER(2个节点)上运行Spark应用程序,但似乎这两个节点是不平衡的,因为只有一个节点正在工作但另一个节点不工作.

我的剧本:

spark-submit --class org.apache.spark.examples.SparkPi 
--master yarn-cluster --deploy-mode cluster --num-executors 2 
--driver-memory 1G 
--executor-memory 1G 
--executor-cores 2 spark-examples-1.6.1-hadoop2.6.0.jar 1000
Run Code Online (Sandbox Code Playgroud)

我看到我的一个节点正在工作,但另一个节点没有,所以这是不平衡的:

在此输入图像描述 注意:左边是namenode,datanode右边是......

任何的想法 ?

ban*_*ara 0

您正在yarn-cluster集群模式下运行作业 Spark 驱动程序在集群主机上的 ApplicationMaster 中运行

尝试在模式下运行它yarn-client,在客户端模式下 Spark 驱动程序在提交作业的主机上运行,​​因此您将能够在控制台上看到输出

spark-submit --verbose --class org.apache.spark.examples.SparkPi \
--master yarn \
--deploy-mode client \
--num-executors 2 \
--driver-memory 1G \
--executor-memory 1G \
--executor-cores 2 spark-examples-1.6.1-hadoop2.6.0.jar 10
Run Code Online (Sandbox Code Playgroud)