Hadoop 构造远程块时发生Spark I/O错误

Hadoop 构造远程块时发生Spark I/O错误,hadoop,apache-spark,cluster-computing,Hadoop,Apache Spark,Cluster Computing,我想用两台计算机在同一个网络中创建一个自制的spark群集。设置如下所示: 17/07/25 19:02:51 INFO SparkContext: Added file hdfs://192.168.1.9:9000/bigdata/input_1_new_grid.pkl at hdfs://192.168.1.9:9000/bigdata/input_1_new_grid.pkl with timestamp 1501002171301 17/07/25 19:02:51 INFO Uti

我想用两台计算机在同一个网络中创建一个自制的spark群集。设置如下所示:

17/07/25 19:02:51 INFO SparkContext: Added file hdfs://192.168.1.9:9000/bigdata/input_1_new_grid.pkl at hdfs://192.168.1.9:9000/bigdata/input_1_new_grid.pkl with timestamp 1501002171301
17/07/25 19:02:51 INFO Utils: Fetching hdfs://192.168.1.9:9000/bigdata/input_1_new_grid.pkl to /tmp/spark-838c3774-36ec-4db1-ab01-a8a8c627b100/userFiles-b4973f80-be6e-4f2e-8ba1-cd64ddca369a/fetchFileTemp1979399086141127743.tmp
17/07/25 19:02:51 WARN BlockReaderFactory: I/O error constructing remote block reader.
java.net.ConnectException: Connection refused
        at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
        at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
A) 192.168.1.9安装hadoop hdfs的spark master

Hadoop有一个core-site.xml

<configuration>
<property>
    <name>hadoop.tmp.dir</name>
    <value>/app/hadoop/tmp</value>
</property>
<property>
    <name>fs.defaultFS</name>
    <value>hdfs://0.0.0.0:9000</value>
</property>
</configuration>
但是,如果我想在B中测试程序,当我使用命令在B中执行程序时:

./spark-submit --master local program.py
输出如下:

17/07/25 19:02:51 INFO SparkContext: Added file hdfs://192.168.1.9:9000/bigdata/input_1_new_grid.pkl at hdfs://192.168.1.9:9000/bigdata/input_1_new_grid.pkl with timestamp 1501002171301
17/07/25 19:02:51 INFO Utils: Fetching hdfs://192.168.1.9:9000/bigdata/input_1_new_grid.pkl to /tmp/spark-838c3774-36ec-4db1-ab01-a8a8c627b100/userFiles-b4973f80-be6e-4f2e-8ba1-cd64ddca369a/fetchFileTemp1979399086141127743.tmp
17/07/25 19:02:51 WARN BlockReaderFactory: I/O error constructing remote block reader.
java.net.ConnectException: Connection refused
        at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
        at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
后来:

    17/07/25 19:02:51 WARN DFSClient: Failed to connect to /127.0.0.1:50010 for block, add to deadNodes and continue. java.net.ConnectException: Connection refused
java.net.ConnectException: Connection refused
        at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)

程序试图访问127.0.0.1:50010,但它是错误的。我是否也应该在B中安装hadoop?如果没有必要,正确的配置是什么?谢谢大家!

顺便说一句,为了防止有人来寻找某种解决方案,我通过将quickstart.cloudera指向真实IP地址而不是127.0.0.1,解决了我的问题。 默认的/etc/hosts是 127.0.0.1 quickstart.cloudera quickstart localhost localhost.domain

你想要的是 127.0.0.1 localhost localhost.domain xxxIP\u您的虚拟机快速启动的地址。cloudera快速启动


您可能还需要修改/usr/bin/cloudera quickstart ip,因为每次重新启动VM时,主机文件可能会再次重置。

顺便说一句,为了防止有人来寻找某种解决方案,我通过将quickstart.cloudera指向真实的ip地址而不是127.0.0.1,解决了我的问题。 默认的/etc/hosts是 127.0.0.1 quickstart.cloudera quickstart localhost localhost.domain

你想要的是 127.0.0.1 localhost localhost.domain xxxIP\u您的虚拟机快速启动的地址。cloudera快速启动


您可能还需要修改/usr/bin/cloudera quickstart ip,因为每次重新启动VM时,主机文件可能会再次重置。

您能够修复它吗?我使用webhdfs,一切正常,但hdfs似乎对我来说是个问题。@sernle抱歉,我无能为力:(.最后我在Microsoft Azure上部署了我的项目。你能修复它吗?我使用webhdfs,一切正常,但hdfs似乎对我来说是个问题。@sernle抱歉,我无能为力:(.最后我在Microsoft Azure上部署了我的项目。