From c9a186e1d052ef0248661a5da024a56c4fafa75c Mon Sep 17 00:00:00 2001 From: Jimmy Song Date: Tue, 19 Sep 2017 19:33:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=91=BD=E4=BB=A4=E7=A4=BA?= =?UTF-8?q?=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...-spark-with-kubernetes-native-scheduler.md | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/usecases/running-spark-with-kubernetes-native-scheduler.md b/usecases/running-spark-with-kubernetes-native-scheduler.md index b2baca085..a2e09c889 100644 --- a/usecases/running-spark-with-kubernetes-native-scheduler.md +++ b/usecases/running-spark-with-kubernetes-native-scheduler.md @@ -349,6 +349,28 @@ kubectl create -f conf/kubernetes-resource-staging-server.yaml --conf spark.executorEnv.SPARK_USER=hadoop ``` +使用 hadoop 用户提交本地 jar 包的命令示例: + +```bash +./spark-submit \ + --deploy-mode cluster \ + --class com.talkingdata.alluxio.hadooptest \ + --master k8s://https://172.20.0.113:6443 \ + --kubernetes-namespace spark-cluster \ + --conf spark.kubernetes.driverEnv.SPARK_USER=hadoop \ + --conf spark.kubernetes.driverEnv.HADOOP_USER_NAME=hadoop \ + --conf spark.executorEnv.HADOOP_USER_NAME=hadoop \ + --conf spark.executorEnv.SPARK_USER=hadoop \ + --conf spark.kubernetes.authenticate.driver.serviceAccountName=spark \ + --conf spark.executor.instances=5 \ + --conf spark.app.name=spark-pi \ + --conf spark.kubernetes.driver.docker.image=sz-pg-oam-docker-hub-001.tendcloud.com/library/spark-driver:v2.1.0-kubernetes-0.3.1-1 \ + --conf spark.kubernetes.executor.docker.image=sz-pg-oam-docker-hub-001.tendcloud.com/library/spark-executor:v2.1.0-kubernetes-0.3.1-1 \ + --conf spark.kubernetes.initcontainer.docker.image=sz-pg-oam-docker-hub-001.tendcloud.com/library/spark-init:v2.1.0-kubernetes-0.3.1-1 \ + --conf spark.kubernetes.resourceStagingServer.uri=http://172.20.0.114:31000 \ +~/Downloads/tendcloud_2.10-1.0.jar +``` + 详见:https://github.com/apache-spark-on-k8s/spark/issues/408 ## 参考