Spark 对集群的远程执行失败 - HDFS 连接在 8020 被拒绝
Spark Remote execution to Cluster fails - HDFS connection Refused at 8020
我在 YARN 上从 Spark 集群 运行 外部的机器提交 spark-submit 远程作业时遇到问题。
Exception in thread "main" java.net.ConnectionException: Call from remote.dev.local/192.168.10.65 to target.dev.local:8020 failed on connection exception: java.net.ConnectionException: Connection Refused
在我的核心-site.xml:
<property>
<name>fs.defaultFS</name>
<value>hdfs://target.dev.local:8020</value>
<property>
同样在我的 hdfs-site.xml 集群中,我禁用了检查 HDFS 的权限:
<property>
<name>dfs.permissions.enabled</name>
<value>false</value>
<property>
此外,当我从集群外的机器远程登录时:
telnet target.dev.local 8020
我得到
telnet: connect to address 192.168.10.186: Connection Refused
但是,当我
telnet target.dev.local 9000
它说 已连接。
当我 ping target.dev.local
时它也有效。
我在远程机器上的 spark-submit 脚本是:
export HADOOP_CONF_DIR=/<path_to_conf_dir_copied_from_cluster>/
spark-submit --class org.apache.spark.examples.SparkPi \
--master yarn \
--deploy-mode cluster \
--driver-memory 5g \
--executor-memory 50g \
--executor-cores 5 \
--queue default \
<path to jar>.jar \
10
我在这里错过了什么?
原来我不得不改变
<property>
<name>fs.defaultFS</name>
<value>hdfs://target.dev.local:8020</value>
<property>
至
<property>
<name>fs.defaultFS</name>
<value>hdfs://0.0.0.0:8020</value>
<property>
允许外部连接,因为 target.dev.local 位于专用网络交换机中。
我在 YARN 上从 Spark 集群 运行 外部的机器提交 spark-submit 远程作业时遇到问题。
Exception in thread "main" java.net.ConnectionException: Call from remote.dev.local/192.168.10.65 to target.dev.local:8020 failed on connection exception: java.net.ConnectionException: Connection Refused
在我的核心-site.xml:
<property>
<name>fs.defaultFS</name>
<value>hdfs://target.dev.local:8020</value>
<property>
同样在我的 hdfs-site.xml 集群中,我禁用了检查 HDFS 的权限:
<property>
<name>dfs.permissions.enabled</name>
<value>false</value>
<property>
此外,当我从集群外的机器远程登录时:
telnet target.dev.local 8020
我得到
telnet: connect to address 192.168.10.186: Connection Refused
但是,当我
telnet target.dev.local 9000
它说 已连接。
当我 ping target.dev.local
时它也有效。
我在远程机器上的 spark-submit 脚本是:
export HADOOP_CONF_DIR=/<path_to_conf_dir_copied_from_cluster>/
spark-submit --class org.apache.spark.examples.SparkPi \
--master yarn \
--deploy-mode cluster \
--driver-memory 5g \
--executor-memory 50g \
--executor-cores 5 \
--queue default \
<path to jar>.jar \
10
我在这里错过了什么?
原来我不得不改变
<property>
<name>fs.defaultFS</name>
<value>hdfs://target.dev.local:8020</value>
<property>
至
<property>
<name>fs.defaultFS</name>
<value>hdfs://0.0.0.0:8020</value>
<property>
允许外部连接,因为 target.dev.local 位于专用网络交换机中。