apache-spark - 运行集群模式 Spark 作业时如何修复 "Connection refused error"

标签 apache-spark cluster-computing slurm terasort

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

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

> 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

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

最佳答案

问题可能不在于定义 --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

关于apache-spark - 运行集群模式 Spark 作业时如何修复 "Connection refused error",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54084201/

相关文章:

python - `df.loc` 的 pyspark 等价物?

scala - 如何将 double 组的数据帧转换为向量?

ubuntu - 创建 3 节点 Hadoop 集群

caching - 为什么大家都建​​议避免在 Play 2.x 中使用 EHCache 作为分布式缓存?

mysql - CentOS中的mysql集群

ubuntu - 在 Ubuntu 16.04 桌面 : slurmd fails to start 上安装/模拟 SLURM

apache-spark - Spark - csv 读取选项

json - Spark SQL JSON 数据集查询嵌套数据结构

time - 由于时间限制,作业意外取消

linux - 分配给SLURM作业的核心