为什么 spark 不在多个节点上重新划分我的数据框?
Why is spark not repartioning my dataframe over multiple nodes?
我有 128 个内核,8 个节点,每个节点 186Gb 内存。
我有从 jdbc 源加载的数据框 (Df)。它有一个分区。然后我打电话:
c = Df.repartition(128*3).cache().count()
应用程序 web UI 显示缓存的 rdd 有 384 个分区,但所有分区都位于一个节点(我们称之为节点 1),ram 中大小为 57Mb。
当我查看计数阶段时,我看到 384 个任务,全部在节点 1 上执行。
为什么 Spark 没有在所有节点上均匀分布数据帧?
我是 运行 这个 pycharm。这是我设置的配置值:
spark = SparkSession \
.builder \
.master("spark://sparkmaster:7087") \
.appName(__SPARK_APP_NAME__) \
.config("spark.executor.memory", "80g") \
.config("spark.eventlog.enabled", "True") \
.config("spark.eventlog.dir", r"C:\Temp\Athena\UAT\Logs") \
.config("spark.cores.max", 128) \
.config("spark.sql.crossJoin.enabled", "True") \
.config("spark.executor.extraLibraryPath","/net/share/grid/bin/spark/UAT/bin/vertica-jdbc-8.0.0-0.jar") \
.config("spark.serializer", "org.apache.spark.serializer.KryoSerializer") \
.getOrCreate()
这是我的 spark 属性
here we specify the details of the resources and the application
details while submitting the application
./bin/spark-submit \
--class org.apache.spark.examples.SparkPi \
--master spark://207.184.161.138:7077 \
--deploy-mode cluster \
--supervise \
--executor-memory 20G \
--total-executor-cores 100 \
/path/to/examples.jar \
好的,所以这似乎是一个优化。简单地在数据帧上调用 repartition 似乎不会导致它跨节点分布,因为 spark 决定不需要这样做。保存随机播放我猜...
我有 128 个内核,8 个节点,每个节点 186Gb 内存。
我有从 jdbc 源加载的数据框 (Df)。它有一个分区。然后我打电话:
c = Df.repartition(128*3).cache().count()
应用程序 web UI 显示缓存的 rdd 有 384 个分区,但所有分区都位于一个节点(我们称之为节点 1),ram 中大小为 57Mb。
当我查看计数阶段时,我看到 384 个任务,全部在节点 1 上执行。
为什么 Spark 没有在所有节点上均匀分布数据帧?
我是 运行 这个 pycharm。这是我设置的配置值:
spark = SparkSession \
.builder \
.master("spark://sparkmaster:7087") \
.appName(__SPARK_APP_NAME__) \
.config("spark.executor.memory", "80g") \
.config("spark.eventlog.enabled", "True") \
.config("spark.eventlog.dir", r"C:\Temp\Athena\UAT\Logs") \
.config("spark.cores.max", 128) \
.config("spark.sql.crossJoin.enabled", "True") \
.config("spark.executor.extraLibraryPath","/net/share/grid/bin/spark/UAT/bin/vertica-jdbc-8.0.0-0.jar") \
.config("spark.serializer", "org.apache.spark.serializer.KryoSerializer") \
.getOrCreate()
这是我的 spark 属性
here we specify the details of the resources and the application details while submitting the application
./bin/spark-submit \
--class org.apache.spark.examples.SparkPi \
--master spark://207.184.161.138:7077 \
--deploy-mode cluster \
--supervise \
--executor-memory 20G \
--total-executor-cores 100 \
/path/to/examples.jar \
好的,所以这似乎是一个优化。简单地在数据帧上调用 repartition 似乎不会导致它跨节点分布,因为 spark 决定不需要这样做。保存随机播放我猜...