Apache spark 设置PySpark脚本中使用的核心数?
我想知道如何设置PySpark程序中要使用的内核数 我一直在做一些搜索,无法找到明确的答案。您可以使用Apache spark 设置PySpark脚本中使用的核心数?,apache-spark,pyspark,Apache Spark,Pyspark,我想知道如何设置PySpark程序中要使用的内核数 我一直在做一些搜索,无法找到明确的答案。您可以使用--executor cores属性指定使用spark submit提交应用程序时要使用的核心数 以下是一个例子: ./bin/spark-submit --class org.apache.spark.examples.SparkPi \ --master yarn-cluster \ --num-executors 3 \ --driver-memory 4g \
--executor cores
属性指定使用spark submit提交应用程序时要使用的核心数
以下是一个例子:
./bin/spark-submit --class org.apache.spark.examples.SparkPi \
--master yarn-cluster \
--num-executors 3 \
--driver-memory 4g \
--executor-memory 2g \
--executor-cores 1
lib/spark-examples*.jar \
10
您可以使用--executor cores with spark submit进行设置,也可以在代码中使用sc.setexecutenv(key=None,value=None,pairs=None)进行设置