问题安装完hadoop后无法连接dfs

在安装Hadoop并完成namenode和datanode的格式化及启动后,遇到通过'hadoop dfsadmin -report'命令查看报告时显示连接失败的问题。经过排查,发现配置文件中使用的IP地址不正确,原本是公网IP导致连接失败,更改为localhost后成功。建议配置时务必确保使用正确的本机IP地址。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

安装好namenode和datanode后,

1)格式化hdfs成功

namenode -format:格式化Hdfs文件系统

2)启动所有hadoop成功

如果启动datanode不成功,一般是因为防火墙原因,关闭防火墙即可

3)但是查看hdfs 

hadoop dfsadmin -report :查看报告

显示连接失败

15/06/16 11:02:39 INFO ipc.Client: Retrying connect to server: /172.16.80.150:9000. Already tried 0 time(s).
15/06/16 11:02:40 INFO ipc.Client: Retrying connect to server: /172.16.80.150:9000. Already tried 1 time(s).
15/06/16 11:02:41 INFO ipc.Client: Retrying connect to server: /172.16.80.150:9000. Already tried 2 time(s).
15/06/16 11:02:42 INFO ipc.Client: Retrying connect to server: /172.16.80.150:9000. Already tried 3 time(s).
15/06/16 11:02:43 INFO ipc.Client: Retrying connect to server: /172.16.80.150:9000. Already tried 4 time(s).
15/06/16 11:02:44 INFO ipc.Client: Retrying connect to server: /172.16.80.150:9000. Already tried 5 time(s).
15/06/16 11:02:45 INFO ipc.Client: Retrying connect to server: /172.16.80.150:9000. Already tried 6 time(s).
15/06/16 11:02:46 INFO ipc.Client: Retrying connect to server: /172.16.80.150:9000. Already tried 7 time(s).
15/06/16 11:02:47 INFO ipc.Client: Retrying connect to server: /172.16.80.150:9000. Already tried 8 time(s).
15/06/16 11:02:48 INFO ipc.Client: Retrying connect to server: /172.16.80.150:9000. Already tried 9 time(s).
Bad connection to DFS... command aborted.


搞了几遍发现问题是:标红部分之前写的是ip,然后死活就是连接不上hdfs,改成localhost后连接成功,再检查,发现配置里写的ip用的是映射ip,不是本机ip,晕死,粗心大意的毛病不能再犯。大家以后配ip的时候记得至少看 一下ifconfig的地址吧

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>


<!-- Put site-specific property overrides in this file. -->


<configuration>
   <property>
      <name>fs.default.name</name>
      <value>hdfs://localhost:9000</value>//你的namenode的配置,机器名加端口    
      <description>The name of the default file system. Either the literal string "local" or a host:port for DFS.</description>
   </property>


</configuration>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值