EMR EKS 无法启动驱动程序 pod

EMR EKS unable to launch driver pod

如何在 EKS 上的 EMR 中设置资源限制?我的驱动程序 pod 无法启动,因为它请求的 CPU 超出允许范围。这对我来说没有意义。我是 运行 下面文档中的入门代码。

我添加了 --conf spark.driver.limit.cores=2 以尝试使限制高于下面错误消息中列出的限制。我从这里得到这个想法 https://spark.apache.org/docs/latest/running-on-kubernetes.html#spark-properties

这个集群中确实有 istio 运行。我不确定这是否会导致问题。

这是我的代码 运行 触发作业

aws emr-containers start-job-run \
  --virtual-cluster-id blahblah \
  --name pi-4 \
  --execution-role-arn arn:aws:iam::0000000000:role/blahblah_emr_eks_executor_role \
  --release-label emr-6.4.0-latest \
  --job-driver '{
    "sparkSubmitJobDriver": {
      "entryPoint": "s3://us-east-1.elasticmapreduce/emr-containers/samples/wordcount/scripts/wordcount.py",
      "entryPointArguments": ["s3://blahblah/wordcount_output"],
      "sparkSubmitParameters": "--conf spark.executor.instances=2 --conf spark.executor.memory=2G --conf spark.executor.cores=2 --conf spark.driver.cores=1 --conf spark.driver.limit.cores=2"
    }
  }'

这会导致 job-runner 容器失败并显示以下内容:


状态:已终止 原因:错误 消息:线程“main”io.fabric8.kubernetes.client.KubernetesClientException 中的异常:执行失败:POST 在:https://kubernetes.default.svc/api/v1/namespaces/spark/pods。消息:Pod“spark-00000002vepbpmi2hkv-driver”无效:spec.containers[2].resources.requests:无效值:“1”:必须小于或等于 cpu 限制。接收状态:Status(apiVersion=v1, code=422, details=StatusDetails(causes=[StatusCause(field=spec.containers[2].resources.requests, message=Invalid value: "1": must be小于或等于 cpu limit, reason=FieldValueInvalid, additionalProperties={})], group=null, kind=Pod, name=spark-00000002vepbpmi2hkv-driver, retryAfterSeconds=null, uid=null, additionalProperties={ }), kind=Status, message=Pod "spark-00000002vepbpmi2hkv-driver" 无效: spec.containers[2].resources.requests: 无效值: "1": 必须小于或等于 cpu limit, metadata=ListMeta(_continue=null, remainingItemCount=null, resourceVersion=null, selfLink=null, additionalProperties={}), reason=Invalid, status=Failure, additionalProperties={}).在 io.fabric8.kubernetes.client.dsl.base.OperationSupport.requestFailure(OperationSupport.java:589)


关于如何进行的任何想法?

我想通了。

aws emr-containers start-job-run \
  --virtual-cluster-id=blahblah \
  --name=pi-4 \
  --execution-role-arn=arn:aws:iam::blahblahaccount:role/balblah_role_name \
  --release-label=emr-6.4.0-latest \
  --job-driver='{
    "sparkSubmitJobDriver": {
      "entryPoint": "local:///usr/lib/spark/examples/src/main/python/pi.py",
      "sparkSubmitParameters": "--conf spark.executor.instances=1 --conf spark.executor.memory=2G --conf spark.executor.request.cores=1 --conf spark.kubernetes.executor.limit.cores=2 --conf spark.driver.request.cores=1 --conf spark.kubernetes.driver.limit.cores=2
    }
  }'

看来aws文档有误,配置值实际如下

  • --conf spark.{driver|executor}.request.cores
  • --conf spark.{driver|executor}.limit.cores

但是,AWS 文档让您传入 --conf spark.driver.cores=1。这个值似乎没有被承认,我认为这是我的错误的原因。下面的 spark 配置文档提到 spark.driver.request.cores 优先于 spark.driver.cores,我认为这是有道理的,因为当我传递它时该值被识别。

https://spark.apache.org/docs/latest/running-on-kubernetes.html#configuration