eclipse链接Hadoop集群时报错Error:Call From xxx/xxx.xxx.xxx.xxx to hostname1:9000 failed on connection exception

时间:2023-03-09 08:08:04
eclipse链接Hadoop集群时报错Error:Call From xxx/xxx.xxx.xxx.xxx to hostname1:9000 failed on connection exception

  今天用eclipse连接Hadoop集群的时候突然给我报了这样一个错误:Error:Call From xxx/xxx.xxx.xxx.xxx to hostname1:9000 failed on connection exception:java.net.ConnectException:Connection refused:no further information;...如下图所示:

eclipse链接Hadoop集群时报错Error:Call From xxx/xxx.xxx.xxx.xxx to hostname1:9000 failed on connection exception

  通过查看配置信息得到错误原因如下:hdfs-site.xml中配置的DFS Master的端口号和eclipse连接hdfs的端口号不同。

  hdfs-site.xml配置如下:

<configuration>
<property>
<name>dfs.nameservices</name>
<value>ns</value>
</property> <property>
<name>dfs.ha.namenodes.ns</name>
<value>nn1,nn2</value>
</property> <property>
<name>dfs.namenode.rpc-address.ns.nn1</name>
<value>master:8020</value>
</property> <property>
<name>dfs.namenode.rpc-address.ns.nn2</name>
<value>slave1:8020</value>
</property> <property>
<name>dfs.namenode.http-address.ns.nn1</name>
<value>master:</value>
</property>
<property>
<name>dfs.namenode.http-address.ns.nn2</name>
<value>slave1:</value>
</property> <property>
<name>dfs.namenode.shared.edits.dir</name>
<value>qjournal://master:8485;slave1:8485;slave2:8485/ns</value>
</property> <property>
<name>dfs.journalnode.edits.dir</name>
<value>/opt/modules/hadoop-2.6./data/jn</value>
</property> <property>
<name>dfs.client.failover.proxy.provider.ns</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.fencing.ssh.private-key-files</name>
<value>/home/hadoop/.ssh/id_rsa</value>
</property> <property>
<name>dfs.ha.automatic-failover.enabled.ns</name>
<value>true</value>
</property> <property>
<name>ha.zookeeper.quorum</name>
<value>master:,slave1:,slave2:</value>
</property> <property>
     <name>dfs.replication</name>
     <value></value>
</property> <property>
     <name>dfs.permissions.enabled</name>
     <value>false</value>
</property> </configuration>

  注意上面标红的字段,其中明确配置了DFS Master的端口号为8020,可我在eclipse中另外配置为了9000。所以,出现了连接错误。改正之后即可解决问题,如下所示。

eclipse链接Hadoop集群时报错Error:Call From xxx/xxx.xxx.xxx.xxx to hostname1:9000 failed on connection exception

  

以上就是博主为大家介绍的这一板块的主要内容,这都是博主自己的学习过程,希望能给大家带来一定的指导作用,有用的还望大家点个支持,如果对你没用也望包涵,有错误烦请指出。如有期待可关注博主以第一时间获取更新哦,谢谢!

版权声明:本文为博主原创文章,未经博主允许不得转载。