我已经安装了7个运行Ubuntu服务器14.04 LTS的VM实例。instance-1(主机名)运行namenode和其他几个服务,而所有其他实例运行datanode服务。我想在一个datanode的hdfs根目录上创建一个目录,但是我得到了这个错误
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输出
root@instance-2:~# jps
2267 NodeManager
5012 Jps
2274 DataNode这是我在instance-1上的jps输出
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创建目录,但仍然收到相同的错误
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文件
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文件
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命令输出
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 refusedinstance-1上的netstat命令未显示在端口8020上运行的任何内容
root@instance-1:~# netstat -tulpn | grep 8020
root@instance-1:~# netstat -tulpn | grep 8020
root@instance-1:~# netstat -tulpn | grep 8020希望这些信息能帮助你了解这个问题。提前谢谢。
发布于 2015-03-23 22:26:48
尝试禁用Ubuntu虚拟机的防火墙。此链接将帮助您访问disable the firewall。否则,您还可以添加exception to the firewall。
根据云提供商,您可以开放虚拟机的端口。如果您使用的是AMS EC2,请在安全组中打开虚拟机所需的端口号。如果您使用的是Microsoft Azure,请添加所需的端点。
添加异常后,从namenode重新启动hadoop服务。希望一切都能顺利进行。
https://stackoverflow.com/questions/29192088
复制相似问题