为什么不能从 YARN 向 运行 请求超过 32 个内核?

Why cannot more than 32 cores be requested from YARN to run a job?

设置:

Objective:

问题:

当我为 Spark 作业请求超过 32 个执行器内核时,出现以下错误:

Uncaught exception: Invalid resource request, requested virtual cores < 0, or requested virtual cores > max configured, requestedVirtualCores=150, maxVirtualCores=32
at org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerUtils.validateResourceRequest(SchedulerUtils.java:212)
at org.apache.hadoop.yarn.server.resourcemanager.RMServerUtils.validateResourceRequests(RMServerUtils.java:96)
at org.apache.hadoop.yarn.server.resourcemanager.ApplicationMasterService.allocate(ApplicationMasterService.java:501)
at org.apache.hadoop.yarn.api.impl.pb.service.ApplicationMasterProtocolPBServiceImpl.allocate(ApplicationMasterProtocolPBServiceImpl.java:60)
at org.apache.hadoop.yarn.proto.ApplicationMasterProtocol$ApplicationMasterProtocolService.callBlockingMethod(ApplicationMasterProtocol.java:99)
at org.apache.hadoop.ipc.ProtobufRpcEngine$Server$ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:619)
at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:962)
at org.apache.hadoop.ipc.Server$Handler.run(Server.java:2039)
at org.apache.hadoop.ipc.Server$Handler.run(Server.java:2035)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:415)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1628)
at org.apache.hadoop.ipc.Server$Handler.run(Server.java:2033)

这是我的纱线的一些属性-site.xml:

<property>
  <name>yarn.nodemanager.resource.memory-mb</name>
  <value>400000</value>
</property>
<property>
  <name>yarn.scheduler.minimum-allocation-mb</name>
  <value>3072</value>
</property>

从上面的属性来看,我认为我可以请求 400k/3072 = ~130 个核心。但它仍然限制我只能使用 32 个。如何为一个 Spark 作业分配超过 32 个执行器内核?

如果需要更多信息,请告诉我,我会更新问题。

编辑 1:

vcore 设置来自 yarn-site.xml

<property>
  <name>yarn.nodemanager.resource.cpu-vcores</name>
  <value>2</value>
</property>

中纱-site.xml集

<property>
  <name>yarn.scheduler.maximum-allocation-vcores</name>
  <value>130</value>
</property>