前言
在Cloudera manager 环境中,给某一个client节点上添加一个新的hbase gateway。
但是也就是这个时候,在client节点上执行命令
[root@client ~]# hbase shell
提示文章标题的错误.
Description
在安装了hbase client上 gateway ,进行登陆hbase,发现以下报错:
-
[root@client ~]# hbase shell
-
2020-06-09 16:36:59,057 INFO [main] Configuration.deprecation: hadoop.native.lib is deprecated. Instead, use io.native.
-
2020-06-09 16:37:17,368 ERROR [main] : ZooKeeper exists failed after 4 attempts
-
2020-06-09 16:37:17,369 WARN [main] : hconnection-0x7c8c70d60x0, quorum=localhost:2181, baseZNode=/hbase Unable to set watcher on znode (/hbase/hbaseid)
-
$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/hbaseid
-
....
-
HBase Shell; enter 'help<RETURN>' for list of supported commands.
-
Type "exit<RETURN>" to leave the HBase Shell
-
Version 1.2.0-cdh5.11.2, rUnknown, Fri Aug 18 14:10:19 PDT 2017
-
-
hbase(main):001:0> exit
ROOT CAUSE
原因是该hbase的 client链接的zk 一直是本地的zk,可以从报错当中看到:quorum=localhost:2181
-
...
-
WARN [main] : hconnection-0x7c8c70d60x0, quorum=localhost:2181, baseZNode=/hbase Unable to set watcher on znode (/hbase/hbaseid)
-
$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/hbaseid
-
...
未能定位到具体的原因,在部署了hbase gateway之后,不能连接上集群的zk。而对应的另一台client hbase链接没有问题。
Solved
Workround:
在文件当中指定zk的地址即可!
也即在路径/opt/cloudera/parcels/CDH/etc/hbase/
下的 文件configuration
属性下添加以下内容:
-
<configuration>
-
-
<property>
-
<name></name>
-
<value>,slave1.cluster,slave2.cluster</value>
-
</property>
-
-
</configuration>
ps: 对应的 是host 映射。
重试结果:
-
[root@client ]# hbase shell
-
2020-06-09 16:54:27,731 INFO [main] Configuration.deprecation: hadoop.native.lib is deprecated. Instead, use io.native.
-
HBase Shell; enter 'help<RETURN>' for list of supported commands.
-
Type "exit<RETURN>" to leave the HBase Shell
-
Version 1.2.0-cdh5.11.2, rUnknown, Fri Aug 18 14:10:19 PDT 2017
-
-
hbase(main):001:0> list
-
TABLE
-
mx:mx_default_instance_23
-
xiaoxiang_yu:xiaoxiang_4SWJU0FK8I
-
2 row(s) in 0.2290 seconds
-
-
=> ["default:default"]
-
hbase(main):002:0>
成功!
本博客为博主原创,谢绝转载,谢谢!