ERROR: Can't get master address from ZooKeeper; znode data == null

本文介绍了一个关于HBase和ZooKeeper配置的问题,当Ubuntu主机文件配置不当时,会导致Hadoop集群中出现连接拒绝错误。文章详细记录了解决步骤及原因分析。

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

最近配置HBASE+ZOOKEEPER的时候,运行list的时候报下面错误:

 

 

hbase(main):001:0> list
TABLE                                                                                                                                                                           

ERROR: Can't get master address from ZooKeeper; znode data == null

Here is some help for this command:
List all tables in hbase. Optional regular expression parameter could
be used to filter the output. Examples:

  hbase> list
  hbase> list 'abc.*'
  hbase> list 'ns:abc.*'
  hbase> list 'ns:.*'

 

 

网上的方式尝试之后均无法解决,最后发现是因为我修改了unbuntu的host文件配置导致的:

失败时的配置:

127.0.0.1    localhost

127.0.0.1    S01

192.168.159.128    S01


# The following lines are desirable for IPv6 capable hosts
#::1     localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

这个配置的时候启动hadoop正常,JPS看不出任何问题,但是在运行hadoop fs -ls查看hdfs文件系统的时候报一下错误:

root@S01:~# hadoop fs -ls
15/12/04 18:53:59 WARN ipc.Client: Address change detected. Old: S01/192.168.159.128:9000 New: S01/127.0.1.1:9000
ls: Call From S01/127.0.1.1 to S01:9000 failed on connection exception: java.net.ConnectException: Connection refused; For more details see:  http://wiki.apache.org/hadoop/ConnectionRefused

 

然后我把hosts文件修改成下面的内容后,报错解决,HBASE也完全正常了

 

127.0.0.1    localhost


# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

 

查了相关资料后发现,可能hadoop默认使用ipv6连接,而我禁用了IPV6导致上述问题

http://www.d1net.com/bigdata/news/329178.html

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值