問題詳細描述如下:
2016-12-09 15:10:39,160 ERROR [org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation] - The node /hbase is not in ZooKeeper. It should have been written by the master. Check the value configured in 'zookeeper.znode.parent'. There could be a mismatch with the one configured in the master.
2016-12-09 15:10:39,264 ERROR [org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation] - The node /hbase is not in ZooKeeper. It should have been written by the master. Check the value configured in 'zookeeper.znode.parent'. There could be a mismatch with the one configured in the master.
首先,說下我在哪個環節碰到過這個問題。
HBase Java API編程這一步。
偽分布模式下,如(djt002)
hbase-env.sh配置文檔中的HBASE_MANAGES_ZK的默認值是true,它表示HBase使用自身自帶的Zookeeper實例。
但是,該實例只能為單機或偽分布模式下的HBase提供服務。
當然,你也可以,在單擊或偽分布模式下,使用外置安裝的Zookeeper。
若是分布式模式,則需要配置自己的Zookeeper集群。如(HadoopMaster、HadoopSlave1、HadoopSlave2)
hbase-env.sh配置文檔中的HBASE_MANAGES_ZK的默認值是true,它表示,分布式模式里,在啟動HBase時,HBase將Zookeeper作為自身的一部分運行。進程變為HQuorumPeer。
hbase-env.sh配置文檔中的HBASE_MANAGES_ZK的默認值是false,它表示,分布式模式里,需要,先提前手動,每個節點都手動啟動Zookeeper,然后再在主節點上啟動
HBase時,進程變為HMaster(HadoopMaster節點)。
問題的解決辦法:
這個坑搞了很久
主要原因是獨立安裝的zookeeper並沒有創建/znode
導致Hbase無法定位到默認的znode--- /hbase
解決方法:
運行zookeeper:./zkCli.sh
創建znode: create /hbase myhbase
現在重啟hbase ,hmaster和regionserver正常啟動
但是hbase shell出現bug
若,還出現如下問題的話,則
這可能是hostname出現問題
解決方案:
修改/etc/hostname 將主機名設置正確