如何在EKS上设置EMR的资源限制?我的驱动程序未能启动,因为它请求的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容器失败,原因如下:
状态:终止原因:错误消息:线程“主”io.fabric8.kubernetes.client.KubernetesClientException:失败中的异常执行: POST at:https://kubernetes.default.svc/api/v1/namespaces/spark/pods。消息: Pod“火花-00000002vepbpmi2hkv-驱动器”无效: spec.containers2.resources.requests:无效值:"1":必须小于或等于cpu限制。接收状态:状态(apiVersion=v1、code=422、apiVersion=v1 message=Invalid值:"1":必须小于或等于cpu限制、reason=FieldValueInvalid、additionalProperties={})、group=null、kind=Pod、name=spark 00000002vepbpmi2hkv-驱动程序、retryAfterSeconds=null、uid=null、additionalProperties={}、kind=Status、message=Pod“火花-00000002vepbmi2hkv-驱动程序”无效: spec.containers2.resources.requests:无效值:"1":“1”:必须小于或等于cpu限制、metadata=ListMeta(_continue=null、remainingItemCount=null、remainingItemCount=null、metadata=ListMeta)、#en21 20#、、#en22{})。在io.fabric8.kubernetes.client.dsl.base.OperationSupport.requestFailure(OperationSupport.java:589)
对如何进行有什么想法吗?
发布于 2021-12-21 18:41:12
我想出了办法。
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.driver.request.cores优先于spark.driver.cores,我认为这是有意义的,因为当我传递该值时会识别它。
https://spark.apache.org/docs/latest/running-on-kubernetes.html#configuration
https://stackoverflow.com/questions/70427566
复制相似问题