错误为:
903152 [main] INFO org.apache.hadoop.ipc.Client - Retrying connect to server: 194.168.8.200/194.168.8.200:8020. Already tried 43 time(s); maxRetries=45
923154 [main] INFO org.apache.hadoop.ipc.Client - Retrying connect to server: 194.168.8.200/194.168.8.200:8020. Already tried 44 time(s); maxRetries=45
943156 [main] DEBUG org.apache.hadoop.ipc.Client - closing ipc connection to 194.168.8.200/194.168.8.200:8020: 20000 millis timeout while waiting for channel to be ready for connect. ch : java.nio.channels.SocketChannel[connection-pending remote=194.168.8.200/194.168.8.200:8020]
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=194.168.8.200/194.168.8.200:8020]
显示一直重连,但ip可以正常通过cmd ping通,也可以在网页上登录50070端口
原因:hadoop配置中为bigdata(host文件中映射),而代码中配置的ip
解决:将代码中配置为映射名bigdata,再在C:\Windows\System32\drivers\etc下的hosts文件中添加映射即可.
如: bigdata 194.168.x.x