2016-03-14 52 views
0

我创建了使用两个节点HDFS DFS -copyFromLocal Datanode的拒绝连接

Hadoop集群

H01:主机 - Ubuntu桌面15.04

H02:用我的主机上的VMware虚拟机 - Ubuntu服务器14.04

jps命令显示h01上的namenode和secondarynamenode,h02上的datanode以及namenode的Web UI显示datanode,以便它们成功连接。

问题是,当我发出命令:

hdfs dfs -copyFromLocal input/

它提供了以下错误:

16/03/14 14:29:55 INFO hdfs.DFSClient: Exception in createBlockOutputStream 
java.net.ConnectException: Connection refused 
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) 
    at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:744) 
    at org.apache.hadoop.net.SocketIOWithTimeout.connect(SocketIOWithTimeout.java:206) 
    at org.apache.hadoop.net.NetUtils.connect(NetUtils.java:530) 
    at org.apache.hadoop.hdfs.DFSOutputStream.createSocketForPipeline(DFSOutputStream.java:1610) 
    at org.apache.hadoop.hdfs.DFSOutputStream$DataStreamer.createBlockOutputStream(DFSOutputStream.java:1408) 
    at org.apache.hadoop.hdfs.DFSOutputStream$DataStreamer.nextBlockOutputStream(DFSOutputStream.java:1361) 
    at org.apache.hadoop.hdfs.DFSOutputStream$DataStreamer.run(DFSOutputStream.java:588) 

我是新来的Hadoop和任何帮助,将不胜感激。以下是我的配置文件:

文件:/ etc/hosts中机:H01

127.0.0.1 localhost 
127.0.1.1 hitesh-SVE15136CNB 
192.168.93.128 h02 
172.16.87.68 h01 
# The following lines are desirable for IPv6 capable hosts 
::1  ip6-localhost ip6-loopback 
fe00::0 ip6-localnet 
ff00::0 ip6-mcastprefix 
ff02::1 ip6-allnodes 
ff02::2 ip6-allrouters 

文件:/ etc/hosts中机:H02

127.0.0.1 localhost 
127.0.1.1 ubuntu 
172.16.87.68 h01 
192.168.93.128 h02 
# The following lines are desirable for IPv6 capable hosts 
::1  localhost ip6-localhost ip6-loopback 
ff02::1 ip6-allnodes 
ff02::2 ip6-allrouters 

文件:核心的site.xml机:都是相同

<configuration> 
    <property> 
    <name>fs.defaultFS</name> 
    <value>hdfs://h01:9000</value> 
    </property> 
    <property> 
     <name>hadoop.tmp.dir</name> 
     <value>/home/hadoop/hadoop</value> 
     </property> 
</configuration> 

文件:HDFS-site.xml中机:都是相同

<configuration> 
    <property> 
     <name>dfs.replication</name> 
     <value>1</value> 
    </property> 
</configuration> 

主设备包含h01,从设备包含h02。我已经确保两台机器之间没有密码的ssh连接。

编辑:

我发现了这个问题。在namenode UI的datanodes选项卡中,它显示的是正确的datanode,但显示的IP不正确(它显示namenode的ip而不是datanode)。 我尝试在不同的虚拟机中安装namenode,它正在工作。 但仍然无法理解上述配置错误的地方。 请帮忙

回答