写了一个简单的java代码查看hdfs 上文件内容,结果无法连接,出现Retrying connect to server: localhost/127.0.0.1:8020,具体如下:
4/03/24 18:45:56 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:8020. Already tried 0 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1 SECONDS)
14/03/24 18:45:57 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:8020. Already tried 1 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1 SECONDS)
14/03/24 18:45:58 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:8020. Already tried 2 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1 SECONDS)
14/03/24 18:45:59 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:8020. Already tried 3 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1 SECONDS)
14/03/24 18:46:00 INFO ipc.Client: Retrying connect to server: localhost

在尝试使用Java代码通过Hadoop API连接HDFS时遇到问题,报错显示' Retrying connect to server: localhost/127.0.0.1:8020'。错误原因在于未指定正确的端口。解决方案是将连接地址改为'hdfs://localhost:9000',从而成功连接。
最低0.47元/天 解锁文章
1163

被折叠的 条评论
为什么被折叠?



