首页 文章

如何更改spark中的核心数?

提问于
浏览
0

我有以下代码

import com.datastax.spark.connector._
sc.cassandraTable("test", "hello").cassandraCount

这需要大约1小时30分钟才能完成,但在此过程中它会产生以下输出

[第0阶段:>(12 2)/ 26674]

其中26674是任务总数,12是完成的任务 The most important one in the number 2 which is the number of tasks that can run in parallel other words max number of cores this application can use is 2. so my big question is How to change this ?

我有1个spark主节点和2个spark worker节点每个Spark worker节点有4vCPU和16GB RAM(m4.xlarge) .

我试着用以下标志的不同值搞乱

--executor-cores --total-executor-cores --num-executors

but I wasn't able to change 2 to something higher 任何想法?

我使用单独的Spark Stand集群

1 回答

  • 0

    conf / spark-env.sh中的 export SPARK_WORKER_CORES=12 是超额订阅可以并行运行的核心数量的方法

相关问题