idea 使用 Java api 连接hdfs卡住无报错,一直重复连接

1 篇文章 0 订阅
1 篇文章 0 订阅

错误为:
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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值