我正在尝试在Hadoop 2.2.0集群上运行字数示例。由于以下异常,许多地图失败:
2014-01-07 05:07:12,544 WARN [main] org.apache.hadoop.mapred.YarnChild: Exception running child : java.net.ConnectException: Call From slave2-machine/127.0.1.1 to slave2-machine:49222 failed on connection exception: java.net.ConnectException: Connection refused; For more details see: http://wiki.apache.org/hadoop/ConnectionRefused
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.apache.hadoop.net.NetUtils.wrapWithMessage(NetUtils.java:783)
at org.apache.hadoop.net.NetUtils.wrapException(NetUtils.java:730)
at org.apache.hadoop.ipc.Client.call(Client.java:1351)
at org.apache.hadoop.ipc.Client.call(Client.java:1300)
at org.apache.hadoop.ipc.WritableRpcEngine$Invoker.invoke(WritableRpcEngine.java:231)
at com.sun.proxy.$Proxy6.getTask(Unknown Source)
at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:133)
Caused by: java.net.ConnectException: Connection refused
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:708)
at org.apache.hadoop.net.SocketIOWithTimeout.connect(SocketIOWithTimeout.java:206)
at org.apache.hadoop.net.NetUtils.connect(NetUtils.java:529)
at org.apache.hadoop.net.NetUtils.connect(NetUtils.java:493)
at org.apache.hadoop.ipc.Client$Connection.setupConnection(Client.java:547)
at org.apache.hadoop.ipc.Client$Connection.setupIOstreams(Client.java:642)
at org.apache.hadoop.ipc.Client$Connection.access$2600(Client.java:314)
at org.apache.hadoop.ipc.Client.getConnection(Client.java:1399)
at org.apache.hadoop.ipc.Client.call(Client.java:1318)
... 4 more
每次运行作业时,都会更改有问题的端口,但映射任务仍然失败。我不知道哪个进程应该侦听该端口。我还尝试在运行期间跟踪netstat -ntlp
输出,但没有进程从未侦听端口。
更新:主节点/etc/hosts
的内容如下:
127.0.0.1 localhost
127.0.1.1 master-machine
# 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
192.168.1.101 slave1 slave1-machine
192.168.1.102 slave2 slave2-machine
192.168.1.1 master
对于 slave1 是:
127.0.0.1 localhost
127.0.1.1 slave1-machine
# 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
192.168.1.1 master
192.168.1.101 slave1
192.168.1.102 slave2 slave2-machine
对于 slave2,它就像 slave1,我想你可以猜到一些细微的变化。最后,关于大师的yarn/hadoop/etc/hadoop/slaves
内容是:
slave1
slave2
1.检查Hadoop节点是否可以相互ssh。2.检查所有配置文件中Hadoop守护程序的地址和端口是否彼此相似。3.检查所有节点的/etc/主机。这是一个有用的链接,用于检查您是否已正确启动集群:群集设置
我明白了! 您的/etc/hosts 不正确。 您应该删除 127.0.1.1 行。我的意思是他们应该是这样的:
127.0.0.1 localhost
192.168.1.101 master
192.168.1.103 slave1
192.168.1.104 slave2
192.168.1.105 slave3
并像这样为所有奴隶复制粘贴。 此外,奴隶也应该能够相互ssh。