最終解決了,其實我心中有一句MMP。
版本:
hadoop 2.6.4 + hbase0.98
第一個問題,端口問題8020
hadoop默認的namenode 資源子接口是8020 端口,然后我這接口已經改成了9000.但是不知道為啥 hbase 還是去找那個8020
解決辦法把那個rootdir 換成root.dir
解決了,但是發現Hmaster 總是啟動之后 ,一段時間之后就掛了,
然后還出現了zk中找不到master,
hbase運行時ERROR:org.apache.hadoop.hbase.PleaseHoldException:Master is initializing的解決方法
ERROR: org.apache.hadoop.hbase.PleaseHoldException: Master is initializing
at org.apache.hadoop.hbase.master.HMaster.checkInitialized(HMaster.java:1869)
at org.apache.hadoop.hbase.master.MasterRpcServices.getTableDescriptors(MasterRpcServices.java:775)
at org.apache.hadoop.hbase.protobuf.generated.MasterProtos$MasterService$2.callBlockingMethod(MasterProtos.java:42402)
at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:2031)
at org.apache.hadoop.hbase.ipc.CallRunner.run(CallRunner.java:107)
at org.apache.hadoop.hbase.ipc.RpcExecutor.consumerLoop(RpcExecutor.java:130)
at org.apache.hadoop.hbase.ipc.RpcExecutor$1.run(RpcExecutor.java:107)
at java.lang.Thread.run(Thread.java:744)
Here is some help for this command:
List all 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:.*'
出現這種問題的原因是因為多台節點的時間不同步,導致節點之間的連接時間超時,這時只需要通過 ntpdate 0.cn.pool.ntp.org 命令使各個節點的時間跟網絡時間同步即可。
在完成上部操作之后,重啟hbase服務時又會報錯:
ERROR: Can't get master address from ZooKeeper; znode data == null
Here is some help for this command:
List all 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:.*'
這時,出現的問題是由於節點多次或長期掛起導致的zookeeper不穩定,我們可以通過多次重啟hbase服務或者是格式化namenode和DataNode,解決問題。
大致就是上面那樣解決的!