解决FATAL ha.BootstrapStandby: Unable to fetch namespace information from active NN at node1/ip.....

1. 报错详细描述

在搭建 HDFS 高可用集群的过程中,执行 hdfs namenode -bootstrapStandby 进行同步的时候出现报错:

FATAL ha.BootstrapStandby: Unable to fetch namespace information from active NN at node1/192.168.146.111:8020: Call From node2/192.168.146.112 to node1:8020 failed on connection excep
tion: java.net.ConnectException: Connection refused; For more details see:  http://wiki.apache.org/hadoop/ConnectionRefused

在这里插入图片描述

2. 解决步骤(详细剖析)

20/11/21 01:34:16 INFO ipc.Client: Retrying connect to server: node1/192.168.146.111:8020. Already tried 0 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1000 MIL
LISECONDS)20/11/21 01:34:17 INFO ipc.Client: Retrying connect to server: node1/192.168.146.111:8020. Already tried 1 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1000 MIL
LISECONDS)20/11/21 01:34:18 INFO ipc.Client: Retrying connect to server: node1/192.168.146.111:8020. Already tried 2 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1000 MIL
LISECONDS)20/11/21 01:34:19 INFO ipc.Client: Retrying connect to server: node1/192.168.146.111:8020. Already tried 3 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1000 MIL
LISECONDS)20/11/21 01:34:20 INFO ipc.Client: Retrying connect to server: node1/192.168.146.111:8020. Already tried 4 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1000 MIL
LISECONDS)20/11/21 01:34:21 INFO ipc.Client: Retrying connect to server: node1/192.168.146.111:8020. Already tried 5 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1000 MIL
LISECONDS)20/11/21 01:34:22 INFO ipc.Client: Retrying connect to server: node1/192.168.146.111:8020. Already tried 6 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1000 MIL
LISECONDS)20/11/21 01:34:23 INFO ipc.Client: Retrying connect to server: node1/192.168.146.111:8020. Already tried 7 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1000 MIL
LISECONDS)20/11/21 01:34:24 INFO ipc.Client: Retrying connect to server: node1/192.168.146.111:8020. Already tried 8 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1000 MIL
LISECONDS)20/11/21 01:34:25 INFO ipc.Client: Retrying connect to server: node1/192.168.146.111:8020. Already tried 9 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1000 MIL
LISECONDS

可以看到尝试了多次,node2 依旧无法感受到 node1 已经启动 NameNode 并处于 active 状态——Unable to fetch namespace information from active NN at node1/192.168.146.111:8020

怎么办呢,网上也没几个可以用的方法
最后发现是自己之前图方便,修改了 /etc/hosts 文件导致的
我之前把 hosts 文件前两行中的 localhost.localdomain 换成了主机名:

127.0.0.1   localhost node2 localhost4 localhost4.localdomain4
::1         localhost node2 localhost6 localhost6.localdomain6

把它换回来 >>

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
# 换完之后,ip映射别忘了再搞一个,不然又多了个问题
ip  主机名

最后把 主NameNode 所在节点(我这里是node1)重启一下,在备NameNode节点(我这里是node2)再次执行 hdfs namenode -bootstrapStandby 即可。

Look~~我的阔以了:

在这里插入图片描述

  • 3
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值