首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >java.net.ConnectException:使用外壳命令时在Hadoop中拒绝连接

java.net.ConnectException:使用外壳命令时在Hadoop中拒绝连接
EN

Stack Overflow用户
提问于 2015-03-22 15:41:18
回答 1查看 3.9K关注 0票数 0

我已经安装了7个运行Ubuntu服务器14.04 LTS的VM实例。instance-1(主机名)运行namenode和其他几个服务,而所有其他实例运行datanode服务。我想在一个datanode的hdfs根目录上创建一个目录,但是我得到了这个错误

代码语言:javascript
复制
root@instance-2:~# hdfs dfs -mkdir hdfs://localhost/user/
mkdir: Call From instance-2/10.240.17.255 to localhost:8020 failed on
connection exception: java.net.ConnectException: Connection refused; For 
more details see:  http://wiki.apache.org/hadoop/ConnectionRefused
root@instance-2:~# hdfs dfs -mkdir hdfs://instance-2/user/
mkdir: Call From instance-2/10.240.17.255 to instance-2:8020 failed on
connection exception: java.net.ConnectException: Connection refused; For 
more details see:  http://wiki.apache.org/hadoop/ConnectionRefused

这是我在instance-2上的jps输出

代码语言:javascript
复制
root@instance-2:~# jps
2267 NodeManager
5012 Jps
2274 DataNode

这是我在instance-1上的jps输出

代码语言:javascript
复制
root@instance-1:~# jps
9043 Jps
1490 Main
3011 RunJar
3227 ResourceManager
4736 HeadlampServer
2409 SecondaryNameNode
3095 JobHistoryServer
2411 QuorumPeerMain
2734 AlertPublisher
2423 RunJar
2562 Bootstrap
5059 Main
2430 Bootstrap
5174 EventCatcherService
5060 Main
2487 NameNode

我尝试从instance-1创建目录,但仍然收到相同的错误

代码语言:javascript
复制
root@instance-1:~# hdfs dfs -mkdir hdfs://instance-2/user/
mkdir: Call From instance-1/10.240.71.132 to instance-2:8020 failed on 
connection exception: java.net.ConnectException: Connection refused; For 
more details see:  http://wiki.apache.org/hadoop/ConnectionRefused

这是我的instance-1的hosts文件

代码语言:javascript
复制
root@instance-1:~# cat /etc/hosts
127.0.0.1 localhost
10.240.71.132 instance-1
10.240.17.255 instance-2
10.240.50.197 instance-3
10.240.61.121 instance-4
10.240.98.215 instance-5
10.240.72.7 instance-6
10.240.216.72 instance-7
# 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
ff02::3 ip6-allhosts
169.254.169.254 metadata.google.internal metadata

这是我的instance-2的hosts文件

代码语言:javascript
复制
root@instance-2:~# cat /etc/hosts
127.0.0.1 localhost
10.240.71.132 instance-1
10.240.17.255 instance-2
10.240.50.197 instance-3
10.240.61.121 instance-4
10.240.98.215 instance-5
10.240.72.7 instance-6
10.240.216.72 instance-7
# 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
ff02::3 ip6-allhosts
169.254.169.254 metadata.google.internal metadata

以下是telnet命令输出

代码语言:javascript
复制
root@instance-2:~# telnet localhost 8020
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused

root@instance-2:~# telnet instance-2 8020
Trying 10.240.17.255...
telnet: Unable to connect to remote host: Connection refused

instance-1上的netstat命令未显示在端口8020上运行的任何内容

代码语言:javascript
复制
root@instance-1:~# netstat -tulpn | grep 8020
root@instance-1:~# netstat -tulpn | grep 8020
root@instance-1:~# netstat -tulpn | grep 8020

希望这些信息能帮助你了解这个问题。提前谢谢。

EN

回答 1

Stack Overflow用户

发布于 2015-03-23 22:26:48

尝试禁用Ubuntu虚拟机的防火墙。此链接将帮助您访问disable the firewall。否则,您还可以添加exception to the firewall

根据云提供商,您可以开放虚拟机的端口。如果您使用的是AMS EC2,请在安全组中打开虚拟机所需的端口号。如果您使用的是Microsoft Azure,请添加所需的端点。

添加异常后,从namenode重新启动hadoop服务。希望一切都能顺利进行。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/29192088

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档