問題:我用eclipse(Mar.2 Release(4.5.2))連接hadoop2.5.1時報錯:Error:Call From roo/10.30.12.xxx to hostname1:9000 failed on connection exception:Java.NET.ConnectException:Connection refused:no further information;...如下圖所示:
出現(xiàn)原因:hdfs-site.xml中配置的DFS Master的端口號和eclipse連接hdfs的端口號不同。hdfs-site.xml的配置如下:
- <configuration>
- <property>
- <name>dfs.nameservices</name>
- <value>mycluster</value>
- </property>
- <property>
- <name>dfs.ha.namenodes.mycluster</name>
- <value>nn1,nn2</value>
- </property>
- <property>
- <name><span style="color:#ff0000;">dfs.namenode.rpc-address.mycluster.nn1</span></name>
- <value><span style="color:#ff0000;">lida1:8020</span></value>
- </property>
- <property>
- <name>dfs.namenode.rpc-address.mycluster.nn2</name>
- <value>lida2:8020</value>
- </property>
- <property>
- <name>dfs.namenode.http-address.mycluster.nn1</name>
- <value>lida1:50070</value>
- </property>
- <property>
- <name>dfs.namenode.http-address.mycluster.nn2</name>
- <value>lida2:50070</value>
- </property>
- <property>
- <name>dfs.namenode.shared.edits.dir</name>
- <value>qjournal://lida2:8485;lida3:8485;lida4:8485/mycluster</value>
- </property>
- <property>
- <name>dfs.client.failover.proxy.provider.mycluster</name>
- <value>org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider</value>
- </property>
- <property>
- <name>dfs.ha.fencing.methods</name>
- <value>sshfence</value>
- </property>
- <property>
- <name>dfs.ha.automatic-failover.enabled</name>
- <value>true</value>
- </property>
- <property>
- <name>dfs.permissions</name>
- <value>false</value>
- </property>
- </configuration>
hdfs-site.xml里配置的dfs的端口號是8020,,我在用eclipse連接hdfs時卻把端口號寫成了9000,,因此,本地的eclipse連接hdfs肯定被拒絕,。
解決辦法:修改eclipse連接hdfs的端口號即可,。如下圖所示:
修改完端口后,重啟eclipse,,然后再打開DFS locations,,就不報上面的錯了。
|