本篇介绍在四个节点的集群中安装Hbase,Hbase依赖于zookeeper,Hbase的安装包内自带zookeeper,本篇将配置使用单独安装的zookeeper。最后启动时遇到Master is initializing、error telling master we are up的异常,通过修改hosts文件得以解决。
[root@master bin]# /opt/hbase/start-hbase.sh starting master, logging to /opt/hbase/bin/../logs/hbase-root-master-master.out Java HotSpot(TM) 64-BitServer VM warning: ignoring option PermSize=128m; support was removed in8.0 Java HotSpot(TM) 64-BitServer VM warning: ignoring option MaxPermSize=128m; support was removed in8.0 slave2: starting regionserver, logging to /opt/hbase/logs/hbase-root-regionserver-slave2.out slave3: starting regionserver, logging to /opt/hbase/logs/hbase-root-regionserver-slave3.out slave1: starting regionserver, logging to /opt/hbase/logs/hbase-root-regionserver-slave1.out slave2: Java HotSpot(TM) 64-BitServer VM warning: ignoring option PermSize=128m; support was removed in8.0 slave2: Java HotSpot(TM) 64-BitServer VM warning: ignoring option MaxPermSize=128m; support was removed in8.0 slave1: Java HotSpot(TM) 64-BitServer VM warning: ignoring option PermSize=128m; support was removed in8.0 slave1: Java HotSpot(TM) 64-BitServer VM warning: ignoring option MaxPermSize=128m; support was removed in8.0
[root@master logs]# /opt/hbase/bin/hbase shell 2018-01-2417:38:50,902 INFO [main] Configuration.deprecation: hadoop.native.lib is deprecated. Instead, use io.native.lib.available 2018-01-2417:38:53,829 WARN [main] util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/opt/hbase/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/opt/hadoop/share/hadoop/common/lib/slf4j-log4j12-1.7.5.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.2.0-cdh5.7.6, rUnknown, Tue Feb 2115:18:14 PST 2017
hbase(main):001:0> status 1 active master, 0 backup masters, 3 servers, 0 dead, 0.6667 average load
[root@masterbin]# /opt/hbase/bin/hbase shell 2018-01-2416:40:15,994 INFO [main]Configuration.deprecation: hadoop.native.lib is deprecated. Instead, use io.native.lib.available 2018-01-2416:40:18,484 WARN [main] util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in[jar:file:/opt/hbase/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in[jar:file:/opt/hadoop/share/hadoop/common/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is oftype[org.slf4j.impl.Log4jLoggerFactory] HBase Shell; enter 'help<RETURN>' forlistof supported commands. Type "exit<RETURN>"to leave the HBase Shell Version 1.2.0-cdh5.7.6, rUnknown, Tue Feb 2115:18:14 PST 2017
hbase(main):001:0> status
ERROR: org.apache.hadoop.hbase.PleaseHoldException: Master is initializing at org.apache.hadoop.hbase.master.HMaster.checkInitialized(HMaster.java:2316) at org.apache.hadoop.hbase.master.MasterRpcServices.getClusterStatus(MasterRpcServices.java:783) at org.apache.hadoop.hbase.protobuf.generated.MasterProtos$MasterService$2.callBlockingMethod(MasterProtos.java:55652) at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:2170) at org.apache.hadoop.hbase.ipc.CallRunner.run(CallRunner.java:109) at org.apache.hadoop.hbase.ipc.RpcExecutor.consumerLoop(RpcExecutor.java:133) at org.apache.hadoop.hbase.ipc.RpcExecutor$1.run(RpcExecutor.java:108) at java.lang.Thread.run(Thread.java:748)
2018-01-2417:29:32,752 INFO [master:60000.activeMasterManager] master.ServerManager: Waiting for region servers count to settle; currently checked in 0, slept for 529904 ms, expecting minimum of 1, maximum of 2147483647, timeout of 4500 ms, interval of 1500 ms.
2018-01-2417:21:52,093 WARN [regionserver/localhost/127.0.0.1:60020] regionserver.HRegionServer: error telling master we are up com.google.protobuf.ServiceException: java.net.SocketException: Invalid argument at org.apache.hadoop.hbase.ipc.AbstractRpcClient.callBlockingMethod(AbstractRpcClient.java:240) at org.apache.hadoop.hbase.ipc.AbstractRpcClient$BlockingRpcChannelImplementation.callBlockingMethod(AbstractRpcClient.java:336) at org.apache.hadoop.hbase.protobuf.generated.RegionServerStatusProtos$RegionServerStatusService$BlockingStub.regionServerStartup(RegionServerStatusProtos.java:8982) at org.apache.hadoop.hbase.regionserver.HRegionServer.reportForDuty(HRegionServer.java:2300) at org.apache.hadoop.hbase.regionserver.HRegionServer.run(HRegionServer.java:914) at java.lang.Thread.run(Thread.java:748)