启动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 程序查看表信息丢失;
[root@bigdata111 conf]# jps //调用JPS 后台程序启动正常
33666 NameNode
44290 Jps
33766 DataNode
44214 HRegionServer
37207 Main
44009 HQuorumPeer
33931 SecondaryNameNode
44077 HMaster
[root@bigdata111 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' for list of supported commands.
Type "exit" 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=
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 watcher=org.apache.hadoop.hbase.zookeeper.PendingWatcher@5707c1cb
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 登陆成功;
[root@bigdata111 zookeeper-3.4.10]# zkServer.sh start
[root@bigdata111 zookeeper-3.4.10]# start-hbase.sh
[root@bigdata111 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 登陆闪退的情况