Hadoop ConnectTimeoutException

晚上继续学习tfidf示例。在跑TwoJob的时候报如下错误,开始以为是node02的防火墙没关好,但看了一下防火墙确实是关了的。

2019-03-30 23:48:19,705 INFO retry.RetryInvocationHandler (RetryInvocationHandler.java:invoke(144)) - Exception while invoking getFileInfo of class ClientNamenodeProtocolTranslatorPB over node02.DHCP/183.207.215.240:8020 after 1 fail over attempts. Trying to fail over after sleeping for 947ms.
org.apache.hadoop.net.ConnectTimeoutException: Call From FF2R0M0IZ0X5J55/192.168.234.1 to node02.DHCP:8020 failed on socket timeout exception: org.apache.hadoop.net.ConnectTimeoutException: 20000 millis timeout while waiting for channel to be ready for connect. ch : java.nio.channels.SocketChannel[connection-pending remote=node02.DHCP/183.207.215.240:8020]; For more details see: http://wiki.apache.org/hadoop/SocketTimeout
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.apache.hadoop.net.NetUtils.wrapWithMessage(NetUtils.java:792)
at org.apache.hadoop.net.NetUtils.wrapException(NetUtils.java:751)
at org.apache.hadoop.ipc.Client.call(Client.java:1480)
at org.apache.hadoop.ipc.Client.call(Client.java:1413)
at org.apache.hadoop.ipc.ProtobufRpcEngine$Invoker.invoke(ProtobufRpcEngine.java:229)
at com.sun.proxy.$Proxy10.getFileInfo(Unknown Source)
at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolTranslatorPB.getFileInfo(ClientNamenodeProtocolTranslatorPB.java:776)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:191)
at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:102)
at com.sun.proxy.$Proxy11.getFileInfo(Unknown Source)
at org.apache.hadoop.hdfs.DFSClient.getFileInfo(DFSClient.java:2117)
at org.apache.hadoop.hdfs.DistributedFileSystem$22.doCall(DistributedFileSystem.java:1305)
at org.apache.hadoop.hdfs.DistributedFileSystem$22.doCall(DistributedFileSystem.java:1301)
at org.apache.hadoop.fs.FileSystemLinkResolver.resolve(FileSystemLinkResolver.java:81)
at org.apache.hadoop.hdfs.DistributedFileSystem.getFileStatus(DistributedFileSystem.java:1301)
at org.apache.hadoop.fs.FileSystem.exists(FileSystem.java:1425)
at com.sxt.hadoop.mr.tfidf.TwoJob.main(TwoJob.java:43)
Caused by: org.apache.hadoop.net.ConnectTimeoutException: 20000 millis timeout while waiting for channel to be ready for connect. ch : java.nio.channels.SocketChannel[connection-pending remote=node02.DHCP/183.207.215.240:8020]
at org.apache.hadoop.net.NetUtils.connect(NetUtils.java:534)
at org.apache.hadoop.net.NetUtils.connect(NetUtils.java:495)
at org.apache.hadoop.ipc.Client$Connection.setupConnection(Client.java:615)
at org.apache.hadoop.ipc.Client$Connection.setupIOstreams(Client.java:713)
at org.apache.hadoop.ipc.Client$Connection.access$2900(Client.java:376)
at org.apache.hadoop.ipc.Client.getConnection(Client.java:1529)
at org.apache.hadoop.ipc.Client.call(Client.java:1452)
... 18 more

 

网上搜索了半天ConnectTimeoutException相关的问题,还是没找到解决办法。

因为是在Windows上单机模拟跑,然后怀疑是不是下面这几个文件的版本不是跟我用的Hadoop 2.7.7不匹配,于是网上去下载了对应版本的文件,但替换之后还是不行。

Hadoop ConnectTimeoutException_第1张图片

出现这种问题,实在没办法还是看老老实实的看异常信息吧——有点本末倒置的感觉-_-||

异常信息中两点引起了我的怀疑,一是node02之后的DHCP,另外就是node02的IP地址跟我设置的对不上,感觉抓住了问题的尾巴。

最终,误打误撞看到的这个网页http://bbs.chinaunix.net/thread-4162740-1-1.html(dhcp绑定ip和设定主机名无效,求助 )给了我启发,我把笔记本的网络断掉,重新跑TwoJob,结果问题解决了...

难道是谁连了我的WiFi,把我分配给node02的ip地址占用了???

转载于:https://www.cnblogs.com/144823836yj/p/10629856.html

你可能感兴趣的:(Hadoop ConnectTimeoutException)