【问题标题】:starting container process caused \"exec: \\\"driver\\\": executable file not found in $PATH\"\n"启动容器进程导致 \"exec: \\\"driver\\\": 在 $PATH\"\n" 中找不到可执行文件
【发布时间】:2018-09-21 04:27:56
【问题描述】:

我有基于 spring 的 spark 2.3.0 应用程序。我正在尝试在 kubernetes(minikube) 上进行 spark 提交。

我有运行 docker 和 minikube 的 Virtual Box。

opt/spark/bin/spark-submit --master k8s://https://192.168.99.101:8443 --name cfe2 --deploy-mode cluster --class com.yyy.Application --conf spark.executor.instances=1 --conf spark.kubernetes.container.image=docker.io/anantpukale/spark_app:1.3 local://CashFlow-spark2.3.0-shaded.jar

下面是堆栈跟踪:

 start time: N/A
 container images: N/A
 phase: Pending
 status: []
2018-04-11 09:57:52 INFO  LoggingPodStatusWatcherImpl:54 - State changed, new state: 
     pod name: cfe2-c4f95aaeaefb3564b8106ad86e245457-driver
     namespace: default
     labels: spark-app-selector -> spark-dab914d1d34b4ecd9b747708f667ec2b, spark-role -> driver
     pod uid: cc3b39e1-3d6e-11e8-ab1d-080027fcb315
     creation time: 2018-04-11T09:57:51Z
     service account name: default
     volumes: default-token-v48xb
     node name: minikube
     start time: 2018-04-11T09:57:51Z
     container images: docker.io/anantpukale/spark_app:1.3
     phase: Pending
     status: [ContainerStatus(containerID=null, image=docker.io/anantpukale/spark_app:1.3, imageID=, lastState=ContainerState(running=null, terminated=null, waiting=null, additionalProperties={}), name=spark-kubernetes-driver, ready=false, restartCount=0, state=ContainerState(running=null, terminated=null, waiting=ContainerStateWaiting(message=null, reason=ContainerCreating, additionalProperties={}), additionalProperties={}), additionalProperties={})]
2018-04-11 09:57:52 INFO  Client:54 - Waiting for application cfe2 to finish...
2018-04-11 09:57:52 INFO  LoggingPodStatusWatcherImpl:54 - State changed, new state: 
     pod name: cfe2-c4f95aaeaefb3564b8106ad86e245457-driver
     namespace: default
     labels: spark-app-selector -> spark-dab914d1d34b4ecd9b747708f667ec2b, spark-role -> driver
     pod uid: cc3b39e1-3d6e-11e8-ab1d-080027fcb315
     creation time: 2018-04-11T09:57:51Z
     service account name: default
     volumes: default-token-v48xb
     node name: minikube
     start time: 2018-04-11T09:57:51Z
     container images: anantpukale/spark_app:1.3
     phase: Failed
     status: [ContainerStatus(containerID=docker://40eae507eb9b615d3dd44349e936471157428259f583ec6a8ba3bd99d80b013e, image=anantpukale/spark_app:1.3, imageID=docker-pullable://anantpukale/spark_app@sha256:f61b3ef65c727a3ebd8a28362837c0bc90649778b668f78b6a33b7c0ce715227, lastState=ContainerState(running=null, terminated=null, waiting=null, additionalProperties={}), name=spark-kubernetes-driver, ready=false, restartCount=0, state=ContainerState(running=null, terminated=ContainerStateTerminated(containerID=docker://40eae507eb9b615d3dd44349e936471157428259f583ec6a8ba3bd99d80b013e, exitCode=127, finishedAt=Time(time=2018-04-11T09:57:52Z, additionalProperties={}), message=invalid header field value **"oci runtime error:  container_linux.go:247: starting container process caused \"exec: \\\"driver\\\": executable file not found in $PATH\"\n"**, reason=ContainerCannotRun, signal=null, startedAt=Time(time=2018-04-11T09:57:52Z, additionalProperties={}), additionalProperties={}), waiting=null, additionalProperties={}), additionalProperties={})] 
2018-04-11 09:57:52 INFO  LoggingPodStatusWatcherImpl:54 - Container final statuses:
     Container name: spark-kubernetes-driver
     Container image: anantpukale/spark_app:1.3
     Container state: Terminated
     Exit code: 127
2018-04-11 09:57:52 INFO  Client:54 - Application cfe2 finished.
2018-04-11 09:57:52 INFO  ShutdownHookManager:54 - Shutdown hook called
2018-04-11 09:57:52 INFO  ShutdownHookManager:54 - Deleting directory /tmp/spark-d5813d6e-a4af-4bf6-b1fc-dc43c75cd643 

下面是我的 docker 文件的图片。

错误跟踪表明我使用命令“docker”触发了 docker 中的某些内容。 dockerfile

【问题讨论】:

    标签: apache-spark docker spring-boot dockerfile minikube


    【解决方案1】:

    在你的 Dockerfile 中使用 ENV PATH="/opt/spark/bin:${PATH}" 而不是你的行。

    【讨论】:

    • 我按照您的建议更改了上述命令。同样的错误仍然存​​在。
    【解决方案2】:

    您是否可以使用登录到容器

    #>docker run -it --rm docker.io/anantpukale/spark_app:1.3 sh
    

    并尝试运行您要提交的主程序或命令。
    根据这个输出,我们可以尝试进一步调查。

    【讨论】:

    • 是的,我可以在 sh 模式下使用上述命令在 docker 中启动并运行它。但是在这里我需要稍微修改一下我的命令。我现在以本地客户端模式将我的 spark 作业提交到 Kubernetes api 服务器。 /opt/spark/bin/spark-submit --master local --name cfe2 --deploy-mode client --class com.oracle.Application --conf spark.executor.instances=1 --conf spark.kubernetes.container.image=docker.io/anantpukale/spark_app:1.3 CashFlow-2.2.1-SNAPSHOT-shaded.jar
    • 我正在为 kubernetes 版本 1.9.4 使用 minikube
    【解决方案3】:

    连同@hichamx 建议的使用以下代码的更改帮助我克服了 "exec: \"driver\" 问题。

    spark-submit \
        --master k8s://http://127.0.0.1:8001 \
        --name cfe2 \
        --deploy-mode cluster \
        --class com.oracle.Test \
        --conf spark.executor.instances=2 \
        --conf spark.kubernetes.container.image=docker/anantpukale/spark_app:1.1 \
        --conf spark.kubernetes.driver.container.image=docker.io/kubespark/spark-driver:v2.2.0-kubernetes-0.5.0 \
        --conf spark.kubernetes.executor.container.image=docker.io/kubespark/spark-executor:v2.2.0-kubernetes-0.5.0 \
        local://spark-0.0.1-SNAPSHOT.jar
    

    虽然这给出了错误:退出代码:127 和 spark-kubernetes-driver 终止。

    【讨论】:

      【解决方案4】:

      我遇到了这个问题。它与 docker 镜像 ENTRYPOINT 相关。在使用 Kubernetes 的 spark 2.3.0 中,现在有一个 Dockerfile 示例,它使用 kubernetes/dockerfiles/ 中的 ENTRYPOINT 中的特定脚本。如果 docker 映像不使用该特定脚本作为 ENTRYPOINT,则容器无法正常启动。 Spark Kubernetes Docker documentation

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2021-04-23
        • 1970-01-01
        • 2020-01-15
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2022-01-07
        相关资源
        最近更新 更多