【问题标题】:How to fix "Connection refused error" when running a cluster mode spark job运行集群模式火花作业时如何修复“连接被拒绝错误”
【发布时间】:2019-01-08 01:40:55
【问题描述】:

我正在使用 SLURM 作业管理系统的 uni 集群上运行带有 spark 的 terasort 基准测试。当我使用 --master local[8] 时它工作正常,但是当我将主节点设置为我的当前节点时,我收到连接被拒绝错误。

我运行此命令在本地启动应用程序没有问题:

> spark-submit \
    --class com.github.ehiggs.spark.terasort.TeraGen \
    --master local[8] \
    target/spark-terasort-1.1-SNAPSHOT-jar-with-dependencies.jar 1g \
    data/terasort_in

当我使用集群模式时,我收到以下错误:

> spark-submit \
    --class com.github.ehiggs.spark.terasort.TeraGen \
    --master spark://iris-055:7077 \ #name of the cluster-node in use
    --deploy-mode cluster \
    --executor-memory 20G \
    --total-executor-cores 24 \
    target/spark-terasort-1.1-SNAPSHOT-jar-with-dependencies.jar 5g \
    data/terasort_in

输出:

WARN  NativeCodeLoader:62 - Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Exception in thread "main" org.apache.spark.SparkException:  Exception thrown in awaitResult: 
    at
org.apache.spark.util.ThreadUtils$.awaitResult(ThreadUtils.scala:226) 
    at 
.
.
./*many lines of timeout logs etc.*/
.
.
.
Caused by: java.net.ConnectException: Connection refused
... 11 more

我希望命令能够顺利运行并终止,但我无法克服此连接错误。

【问题讨论】:

  • 您能否提供有关您正在使用的集群的更多信息?你确定你的master能找到20GB可用内存的executor内存吗?
  • @Nonontb 当然我可以使用每个节点大约 128GB 的​​最大内存。
  • 好吧,如果您的 id 工作开始,您可以访问 executors 选项卡并告诉分配了多少 executor ? Teragen 根据并行度计算每个执行器的行数。如果 executors 没有正确分配,你可能会面临 executors/drivers 的一些过载。

标签: apache-spark cluster-computing slurm terasort


【解决方案1】:

问题可能是没有定义 --conf 变量。这可以解决:

spark-submit \
    --class com.github.ehiggs.spark.terasort.TeraGen \
    --master spark://iris-055:7077 \
    --conf spark.driver.memory=4g \
    --conf spark.executor.memory=20g \
    --executor-memory 20g \
    --total-executor-cores 24 \
    target/spark-terasort-1.1-SNAPSHOT-jar-with-dependencies.jar 5g \
    data/terasort_in

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-09-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-02-19
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多