[关闭]
@awsekfozc 2016-02-17T21:37:17.000000Z 字数 1160 阅读 2339

Spark Deploy

Spark

Deploy mode

client: 开发测试时使用这个模式
    本地,应用提交的这台机器上

cluster: 生产环境使用这个模式
    运行在集群的work节点上

client

  1. bin/spark-submit \
  2. --deploy-mode client \
  3. --class org.apache.spark.examples.SparkPi \
  4. --master spark://hadoop-zc.com:7077 \
  5. /opt/modules/spark-1.3.0-bin-2.5.0/lib/spark-examples-1.3.0-hadoop2.5.0.jar \
  6. 10

cluster

  1. bin/spark-submit \
  2. --deploy-mode cluster \
  3. --class org.apache.spark.examples.SparkPi \
  4. --master spark://hadoop-zc.com:7077 \
  5. /opt/modules/spark-1.3.0-bin-2.5.0/lib/spark-examples-1.3.0-hadoop2.5.0.jar \
  6. 10

spark on yarn

Spark on yarn有分为两种模式yarn-cluster和yarn-client。yarn-cluster和yarn-client模式的区别其实就是Application Master进程的区别,yarn-cluster模式下,driver运行在AM(Application Master)中,它负责向YARN申请资源,并监督作业的运行状况。当用户提交了作业之后,就可以关掉Client,作业会继续在YARN上运行。然而yarn-cluster模式不适合运行交互类型的作业。而yarn-client模式下,Application Master仅仅向YARN请求executor,client会和请求的container通信来调度他们工作,也就是说Client不能离开。一下是两种模式的提交代码:
  1. bin/spark-submit \
  2. --master yarn-client \
  3. --class org.apache.spark.examples.SparkPi \
  4. /opt/modules/spark-1.3.0-bin-2.5.0/lib/spark-examples-1.3.0-hadoop2.5.0.jar \
  5. 10
  1. bin/spark-submit \
  2. --master yarn-cluster \
  3. --class org.apache.spark.examples.SparkPi \
  4. /opt/modules/spark-1.3.0-bin-2.5.0/lib/spark-examples-1.3.0-hadoop2.5.0.jar \
  5. 10

QQ截图20160129095704.png-53.1kB

QQ截图20160129095833.png-58.7kB

在此输入正文

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注