Closed benni82 closed 6 years ago
Have you tried running it without --conf spark.kubernetes.driverEnv.SPARK_LOCAL_IP=0.0.0.0
?
BTW: can you check the value of environment variable SPARK_DRIVER_BIND_ADDRESS
in the driver container?
I also run task with --conf spark.kubernetes.driverEnv.SPARK_LOCAL_IP=0.0.0.0
,
and runps ef | more
in the driver, but still can not work correctly.
-Dspark.driver.bindAddress= org.apache.spark.examples.SparkPi 5
I run task with '--conf spark.kubernetes.driverEnv.SPARK_DRIVER_BIND_ADDRESS=0.0.0.0' , it work correctly!
OK, so if you don't set SPARK_DRIVER_BIND_ADDRESS
explicitly, what's its value in the driver container? And have you run it without setting SPARK_DRIVER_BIND_ADDRESS
and SPARK_LOCAL_IP
? The Kubernetes downward API is used to set SPARK_DRIVER_BIND_ADDRESS
automatically to the driver pod IP, so you shouldn't need to set it explicitly.
I have to set it explicitly, if run without conf SPARK_DRIVER_BIND_ADDRESS, the driver spark.driver.bindAddress value is empty.
when run without --conf spark.kubernetes.driverEnv.SPARK_LOCAL_IP=0.0.0.0
ps ef | more
14 root 0:16 /usr/lib/jvm/java-1.8-openjdk/bin/java -Dspark.driver.host=spark-pi-1510572734487-driver-svc.default.svc.cluster.local -Dspark.kubernetes.executor.podNamePrefix=spark-pi-1510572734487 -Dspark.driver.port=7078 -Dspark.driver.bindAddress=spark-pi-1510572734487-driver-svc.default.svc.cluster.local -Dspark.master=k8s://https://10.218.13age=kubespark/spark-driver:v2.2.0-kubernetes-0.5.0 -Dspark.executor.instances=3 -Dspark.driver.blockManager.port=7079 -Dspark.submit.deployMode=cluster -Dspark.app.id=spark-4d60858edcfe47189501d25962c6676b -Dspark.kubernetes.namespace=default -Dspark.app.name=spark-pi -Dspark.kubernetes.executor.docker.image=kubespark/spark-executor:v2.2.0-kubernetes-0.5.0 -Dspark.kubernetes.driver.pod.name=spark-pi-1510572734487-driver -Dspark.jars=/opt/spark/examples/jars/spark-examples_2.11-2.2.0-k8s-0.5.0.jar -cp /opt/spark/examples/jars/spark-examples_2.11-2.2.0-k8s-0.5.0.jar:/opt/spark/jars/* -Xms1g -Xmx1g -Dspark.driver.bindAddress= org.apache.spark.examples.SparkPi 100
when run without --conf spark.kubernetes.driverEnv.SPARK_LOCAL_IP=0.0.0.0
I saw both -Dspark.driver.bindAddress=spark-pi-1510572734487-driver-svc.default.svc.cluster.local
and -Dspark.driver.bindAddress=
in the ps
output, which is unexpected. Just to confirm that in this run, you didn't set SPARK_DRIVER_BIND_ADDRESS
, right?
Which version of Spark on K8s are you running, are you using the latest release distribution to submit your job? What's the Kubernetes version of your cluster?
yes, I didn't set SPARK_DRIVER_BIND_ADDRESS .
I used spark-2.2.0-k8s-0.4.0-bin-2.7.3
but use 0.5.0 image kubespark/spark-driver:v2.2.0-kubernetes-0.5.0
bin/spark-submit \
--deploy-mode cluster \
--class org.apache.spark.examples.SparkPi \
--master k8s://https://xxxxxxx:6443 \
--kubernetes-namespace default \
--conf spark.executor.instances=3 \
--conf spark.app.name=spark-pi \
--conf spark.kubernetes.driver.docker.image=kubespark/spark-driver:v2.2.0-kubernetes-0.5.0 \
--conf spark.kubernetes.executor.docker.image=kubespark/spark-executor:v2.2.0-kubernetes-0.5.0 \
local:///opt/spark/examples/jars/spark-examples_2.11-2.2.0-k8s-0.5.0.jar 100
I download spark-2.2.0-k8s-0.5.0-bin-2.7.3, and now can run correctly. It seems I used 0.4.0 version to submit newest(0.5.0) task, which made mistake.
Is this ok to close @benni82
the driver pod
the executor logs
the driver logs
the submit command is