啟動hbase正常,但是用list指令時報錯:
ERROR: Can’t get master address from ZooKeeper; znode data == null
Here is some help for this command:
List all user 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:.*’
先檢視hbase的日志檔案,出現如下錯誤:
2021-12-08 23:51:35,101 FATAL [hadoop01:16000.activeMasterManager] master.HMaster: Failed to become active master
org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.ipc.StandbyException): Operation category READ is not supported in state standby
解決:
①說明了與節點的active和standby有關,我的情況是三台高可用hadoop,其中主節點hadoop01是standby,hadoop02是active,但是還是會報錯,我主動幹預zookeeper選舉,把hadoop01設定成active,hadoop02設定成standby,結果就成功了
主動幹預zookeeper選舉指令:
hdfs haadmin -transitionToStandby --forcemanual nn2
hdfs haadmin -transitionToActive --forcemanual nn1
②高可用hadoop core-site.xml配置的這一塊

和hbase-site.xml不符合,因為當時我是在高可用配置前已經配置好hbase了,後期沒有去改,是以得改過來
修改之後:
再把hadoop 叢集的配置檔案 core-site.xml 和 hdfs-site.xml 這兩個配置檔案複制到hbase的conf目錄下