ClusterId read in ZooKeeper is null

HBase 链接问题

总结写之前spark链接hbase的坑。

  • 异常
Will not attempt to authenticate using SASL (unknown error)
ClusterId read in ZooKeeper is null
  • HBase 配置代码
val hBaseConf = HBaseConfiguration.create()
hBaseConf.set("hbase.zookeeper.quorum","fp-bd6,fp-bd5")
hBaseConf.set("hbase.zookeeper.property.clientPort","2181")
hBaseConf.set("hbase.defaults.for.version.skip","true")
  • 解决方法

    添加 hBaseConf.set("zookeeper.znode.parent","/hbase-unsecure")
    The value of zookeeper.znode.parent in HBASE_CONF/hbase-site.xml is specified as /hbase-unsecure (see below) which is correct but for some reason (still trying to figure this out), the value being printed is /hbase. So currently I’ve overridden this programatically in the client program by adding the following line to the program。
    大致意思是:虽然hbase-site.xml配置了hbase-unsecure,这是正确的。但由于某种原因(仍然试图弄清楚),打印的值是/ hbase。
    官方文档中有提到:If both clusters use the same ZooKeeper cluster, you must use a different zookeeper.znode.parent, because they cannot write in the same folder。
    所以这里需要单独设置zookeeper.znode.paren 的属性。

  • 参考
    http://www.voidcn.com/article/p-brotelji-tx.html

猜你喜欢

转载自blog.csdn.net/yyoc97/article/details/82560667