最近配置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