1. 程式人生 > >ClusterId read in ZooKeeper is null

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