ERROR: Can't get master address from ZooKeeper; znode data == null 一定注意这只是问题的第一层表象,真的问题是:
File /hbase/.tmp/hbase.version could only be replicated to 0 nodes instead of minReplica
网上很多都是叫用两种方式解决
- stop/start 重启hbase
- 格式化 hdfs namenode -format,不能随随便便就格式话hadoop的namenode
按照上述方式试一两个小时找问题,没有找到,最后问题就在每个应用的日志里藏着
Hbase中启动中很多异常的坑会遇到,但是请一定不要慌,坑多是因为我们对她不熟悉,我找了一上午的错误例子,在今年5月份我记得我可以启动单机的hbase hadoop zookeeper,由于我的阿里云服务器要用作别用,我就关闭了三个应用,9月我再次启动时,就不能启动了。
org.apache.hadoop.ipc.RemoteException(java.io.IOException): File /hbase/.tmp/hbase.version could only be replicated to nodes instead of minReplication (=). There are datanode(s) running and no node(s) are excluded in this operation.
at org.apache.hadoop.hdfs.server.blockmanagement.BlockManager.chooseTarget4NewBlock(BlockManager.java:)
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getAdditionalBlock(FSNamesystem.java:)
at org.apache.hadoop.hdfs.server.namenode.NameNodeRpcServer.addBlock(NameNodeRpcServer.java:)
at org.apache.hadoop.hdfs.server.namenode.AuthorizationProviderProxyClientProtocol.addBlock(AuthorizationProviderProxyClientProtocol.java:)
at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolServerSideTranslatorPB.addBlock(ClientNamenodeProtocolServerSideTranslatorPB.java:)
at org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos$ClientNamenodeProtocol$.callBlockingMethod(ClientNamenodeProtocolProtos.java)
at org.apache.hadoop.ipc.ProtobufRpcEngine$Server$ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:)
at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:)
at org.apache.hadoop.ipc.Server$Handler$.run(Server.java:)
at org.apache.hadoop.ipc.Server$Handler$.run(Server.java:)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:)
at org.apache.hadoop.ipc.Server$Handler.run(Server.java:) at org.apache.hadoop.ipc.Client.call(Client.java:)
at org.apache.hadoop.ipc.Client.call(Client.java:)
at org.apache.hadoop.ipc.ProtobufRpcEngine$Invoker.invoke(ProtobufRpcEngine.java:)
at com.sun.proxy.$Proxy17.addBlock(Unknown Source)
at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolTranslatorPB.addBlock(ClientNamenodeProtocolTranslatorPB.java:)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:)
at java.lang.reflect.Method.invoke(Method.java:)
at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:)
at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:)
at com.sun.proxy.$Proxy18.addBlock(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:)
at java.lang.reflect.Method.invoke(Method.java:)
at org.apache.hadoop.hbase.fs.HFileSystem$.invoke(HFileSystem.java:)
at com.sun.proxy.$Proxy19.addBlock(Unknown Source)
at org.apache.hadoop.hdfs.DFSOutputStream$DataStreamer.locateFollowingBlock(DFSOutputStream.java:)
at org.apache.hadoop.hdfs.DFSOutputStream$DataStreamer.nextBlockOutputStream(DFSOutputStream.java:)
at org.apache.hadoop.hdfs.DFSOutputStream$DataStreamer.run(DFSOutputStream.java:)
-- ::, INFO [app:.activeMasterManager] regionserver.HRegionServer: STOPPED: Unhandled exception. Starting shutdown.
-- ::, INFO [master/app.server/172.16.216.42:] regionserver.HRegionServer: Stopping infoServer
-- ::, INFO [master/app.server/172.16.216.42:] mortbay.log: Stopped [email protected]:
我打开hbase hadoop zookeeper 三者中data缓存文件,里面还是5月份的数据,比较坑就是每次重启都不自己覆盖以前的文件的么。这里就以后不要用kill 去关掉线程了
[root@app hbase-1.2.-cdh5.10.0]# cd data/tmp/
重新启动 hbase hadoop zookeeper 进入 hbase shell命令客户端
[root@app bin]# ./hbase shell
-- ::, INFO [main] Configuration.deprecation: hadoop.native.lib is deprecated. Instead, use io.native.lib.available
-- ::, WARN [main] util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
HBase Shell; enter 'help<RETURN>' for list of supported commands.
Type "exit<RETURN>" to leave the HBase Shell
Version 1.2.-cdh5.10.0, rUnknown, Fri Jan :: PST hbase(main)::> list
TABLE
row(s) in 0.3760 seconds => []
hbase(main)::>
最后强调一下jps 查看最近启动的进程中是不是全部启动,我这里是单机版的,仅供参考。
[root@app tmp]# jps
Jps
HRegionServer
HMaster
QuorumPeerMain
DataNode
SecondaryNameNode
Main
NameNode
[root@app tmp]#