Hbase自帶Zookeeper啟動後,hmaster退出
阿新 • • 發佈:2018-12-12
啟動Hbase:start-hbase.sh
starting master, logging to /root/training/hbase-1.3.1/logs/hbase-root-master-bigdata111.out Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=128m; support was removed in 8.0 Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0 192.168.128.111: starting regionserver, logging to /root/training/hbase-1.3.1/bin/../logs/hbase-root-regionserver-bigdata111.out 192.168.128.111: Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=128m; support was removed in 8.0 192.168.128.111: Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0
程式啟動正常,hbase shell 程式查看錶資訊丟失;
[[email protected] conf]# jps //呼叫JPS 後臺程式啟動正常 33666 NameNode 44290 Jps 33766 DataNode 44214 HRegionServer 37207 Main 44009 HQuorumPeer 33931 SecondaryNameNode 44077 HMaster [[email protected] conf]# hbase shell //進入Hbase shell 表資料丟失 SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/root/training/hbase-1.3.1/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/root/training/hadoop-2.7.3/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory] HBase Shell; enter 'help<RETURN>' for list of supported commands. Type "exit<RETURN>" to leave the HBase Shell Version 1.3.1, r930b9a55528fe45d8edce7af42fef2d35e77677a, Thu Apr 6 19:36:54 PDT 2017 hbase(main):001:0> list TABLE 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:.*' hbase(main):002:0>
檢視hbase的啟動日誌:
2018-06-29 15:15:32,704 INFO [main] util.ServerCommandLine: env:HBASE_LOG_DIR=/root/training/hbase-1.3.1/logs
2018-06-29 15:15:32,704 INFO [main] util.ServerCommandLine: env:USER=root
2018-06-29 15:15:32,705 INFO [main] util.ServerCommandLine: env:HBASE_MASTER_OPTS= -XX:PermSize=128m -XX:MaxPermSize=128m
2018-06-29 15:15:32,705 INFO [main] util.ServerCommandLine: env:HBASE_MANAGES_ZK=true
2018-06-29 15:15:36,316 INFO [main] zookeeper.ZooKeeper: Client environment:java.library.path=/root/training/hadoop-2.7.3/lib/native
2018-06-29 15:15:36,316 INFO [main] zookeeper.ZooKeeper: Client environment:java.io.tmpdir=/tmp
2018-06-29 15:15:36,316 INFO [main] zookeeper.ZooKeeper: Client environment:java.compiler=<NA>
2018-06-29 15:15:36,316 INFO [main] zookeeper.ZooKeeper: Client environment:os.name=Linux
2018-06-29 15:15:36,316 INFO [main] zookeeper.ZooKeeper: Client environment:os.arch=amd64
2018-06-29 15:15:36,316 INFO [main] zookeeper.ZooKeeper: Client environment:os.version=3.10.0-693.el7.x86_64
2018-06-29 15:15:36,316 INFO [main] zookeeper.ZooKeeper: Client environment:user.name=root
2018-06-29 15:15:36,316 INFO [main] zookeeper.ZooKeeper: Client environment:user.home=/root
2018-06-29 15:15:36,316 INFO [main] zookeeper.ZooKeeper: Client environment:user.dir=/root
2018-06-29 15:15:36,317 INFO [main] zookeeper.ZooKeeper: Initiating client connection, connectString=192.168.128.111:2181 sessionTimeout=90000 [email protected]b
2018-06-29 15:15:36,413 INFO [main-SendThread(192.168.128.111:2181)] zookeeper.ClientCnxn: Opening socket connection to server 192.168.128.111/192.168.128.111:2181. Will not attempt to authenticate using SASL (unknown error)
2018-06-29 15:15:36,419 WARN [main-SendThread(192.168.128.111:2181)] zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: 拒絕連線
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)
2018-06-29 15:15:37,572 INFO [main-SendThread(192.168.128.111:2181)] zookeeper.ClientCnxn: Opening socket connection to server 192.168.128.111/192.168.128.111:2181. Will not attempt to authenticate using SASL (unknown error)
2018-06-29 15:15:37,573 WARN [main-SendThread(192.168.128.111:2181)] zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: 拒絕連線
Zookeeper的2181埠拒絕hbase連線,導致hmaster啟動後直接退出,不能正常啟動;
exception:zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect java.net.ConnectException: 拒絕連線
我採用配置引數是hbase自帶的Zookeeper,之前反覆重啟幾次,會正常登陸,現在採用自己安裝的Zookeeper,啟動hbase,關閉Hbase的自帶的開關:
修改 vi hbase-env.sh
128 # export HBASE_MANAGES_ZK=true //128行註釋
使用自己安裝的Zookeeper,將Zookeeper的zoo.cfg 拷貝到 hbase目錄下的conf目錄中
cp ~/training/zookeeper-3.4.10/conf/zoo.cfg ~/training/hbase-1.3.1/conf/
接著先啟動本地的Zookeeper,再啟動hbase,接著登陸hbase shell 登陸成功;
[[email protected] zookeeper-3.4.10]# zkServer.sh start
[[email protected] zookeeper-3.4.10]# start-hbase.sh
[[email protected] zookeeper-3.4.10]# hbase shell
hbase(main):001:0> list
TABLE
emp
result
results
sss
students
word
6 row(s) in 0.3760 seconds
放棄本地的hbase 改用自己安裝的hbase 可以暫時解決 hmaster 登陸閃退的情況