gpt4 book ai didi

apache-spark - 为什么 spark 没有在多个节点上重新分配我的数据帧?

转载 作者:行者123 更新时间:2023-12-02 03:09:50 32 4
gpt4 key购买 nike

我有 128 个内核、8 个节点、每个节点 186Gb ram。

我有从 jdbc 源加载的数据帧 (Df)。它有一个分区。然后我打电话:

c = Df.repartition(128*3).cache().count()

应用程序 Web UI 显示缓存的 rdd 有 384 个分区,但都位于一个节点(我们称之为节点 1)上,内存大小为 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 属性

enter image description here

最佳答案

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 \

关于apache-spark - 为什么 spark 没有在多个节点上重新分配我的数据帧?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40588373/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com