HRegionServer无法启动,启动hbase后马上挂掉的问题

把这次解决这个问题的操作记录下来,虽然还未搞清楚缘由,下次有空把hbase源码看一看。

自己搭建了个伪分布式的hbase环境,配置好hbase-env.sh、hbase-site.xml、regionservers后启动hbase,使用hbase shell能正常建表等操作。然而idea代码连接却一直日志显示在一处不再动,很久后才报连接异常。

2016-11-12 10:24:35,646 INFO  org.apache.zookeeper.ZooKeeper.(ZooKeeper.java:438) - Initiating client connection, connectString=10.46.179.206:2181 sessionTimeout=90000 watcher=hconnection-0x1c154c2, quorum=10.46.179.206:2181, baseZNode=/hbase
2016-11-12 10:24:35,684 INFO  org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper.(RecoverableZooKeeper.java:120) - Process identifier=hconnection-0x1c154c2 connecting to ZooKeeper ensemble=10.46.179.206:2181
2016-11-12 10:24:35,685 INFO  org.apache.zookeeper.ClientCnxn$SendThread.logStartConnect(ClientCnxn.java:975) - Opening socket connection to server 10.46.179.206/10.46.179.206:2181. Will not attempt to authenticate using SASL (unknown error)
2016-11-12 10:24:35,696 INFO  org.apache.zookeeper.ClientCnxn$SendThread.primeConnection(ClientCnxn.java:852) - Socket connection established to 10.46.179.206/10.46.179.206:2181, initiating session
2016-11-12 10:24:35,736 INFO  org.apache.zookeeper.ClientCnxn$SendThread.onConnected(ClientCnxn.java:1235) - Session establishment complete on server 10.46.179.206/10.46.179.206:2181, sessionid = 0x158568b878d0009, negotiated timeout = 90000

发现HRegionServer没启动起来。异常日志为:


ERROR [main] regionserver.HRegionServerCommandLine: Region server exiting
java.lang.RuntimeException: HRegionServer Aborted
        at org.apache.hadoop.hbase.regionserver.HRegionServerCommandLine.start(HRegionServerCommandLine.java:66)
        at org.apache.hadoop.hbase.regionserver.HRegionServerCommandLine.run(HRegionServerCommandLine.java:85)
        at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
        at org.apache.hadoop.hbase.util.ServerCommandLine.doMain(ServerCommandLine.java:126)
        at org.apache.hadoop.hbase.regionserver.HRegionServer.main(HRegionServer.java:2400)

然后各种搜索对比,尝试了下面各种方法,如:
更改hbase.cluster.distributed属性、hbase.zookeeper.quorum属性、HBASE_MANAGES_ZK属性, 关闭ipv6, 更改regionservers为localhost,更改regionservers文件和hosts文件内的换行符等….皆未见效。
然后刚刚网上看了两篇解决方法,把hosts文件里其它名都注释掉,只留下当前服务器hostname(因为是单机,就只留了一个)。重启,还是不行,再搜,再把配置里一堆乱七八糟的去掉。配置如下:
hbase-site.xml:



<configuration>

   <property>
    <name>hbase.tmp.dirname>
    <value>/home/hadoop/hbase/tmp/hbasevalue>
   property>
  <property>
    <name>hbase.rootdirname>
    <value>hdfs://10.46.179.206:9000/hbasevalue>    
  property>
  <property>
    <name>hbase.cluster.distributedname>
    <value>truevalue>    
  property>
  <property>
    <name>hbase.zookeeper.quorumname>
    <value>ubuntu206value>    
  property>
  <property>
    <name>zookeeper.znode.parentname>
    <value>/hbasevalue>    
  property>  
  <property>
    <name>hbase.superusername>
    <value>hadoopvalue>   
  property>
  <property>
    
    <name>hbase.zookeeper.property.dataDirname>
    <value>/home/hadoop/zookeeperDatavalue>    
  property>
  <property>
    <name>hbase.zookeeper.property.clientPortname>
    <value>2181value>    
  property> 
  <property> 
    
    <name>hbase.coprocessor.abortonerrorname>
    <value>falsevalue>
  property>
configuration>

hbase-env.sh:

export JAVA_HOME="/usr/jdk/linux"
export HBASE_CLASSPATH=$HADOOP_HOME/conf
export HBASE_MANAGES_ZK=false

regionservers:

ubuntu206

之后启动hbase,终于把HregionServer启动起来了,客户端也能正常连接了。
正常后把hosts配置上别的再重启也不影响,问题可能还是出在hbase-site.xml里多配了些什么东西且配错了。

另,hbase正常后,之前kafka客户端连接异常的问题也好了,不管kafka server.properties 内host.name配为主机名还是ip地址都是OK的。。。有点莫名其妙. - -# 。

启发的两篇文章链接也放这:
http://cache.baiducontent.com/c?m=9d78d513d98306f31eb6cb291a17a7315305d7217a8c8d4968d5e35f92174c41363ca3ec72794d58c4c40c2656ef0d0baae7360364537df7dd9fde5e9afbcc2775ce6176671df55c0f924efa9411798774c31db7e90ee7cda16fccb391cedc5650c851077882f2895e0210ce6af2&p=8636da16d9c117ef08e2977e0c419d&newp=99678e5f88904ead08e2977e0c579f231610db2151d7d3116b82c825d7331b001c3bbfb42323160ed6cf7a6401ae4258ebf532783d0221a3dda5c91d9fb4c57479&user=baidu&fm=sc&query=RuntimeException%3A+HRegionServer+Aborted&qid=c9c23e7c00016d67&p1=2

http://cache.baiducontent.com/c?m=9d78d513d98306f31eb6cb291a17a7315305d7217a8c8d4968d5e35f92174c41363ca3ec72794d58c4c40c2656ef0d0baae7360364537df7dd9fde5e9afbcc2775ce6176671df55c0f8347f29e5125b671d10cb5b81990e6a7748ee9d0d0dc5154c8580f719da3cb1c5b459438ed4266a5f5c216544217b8e93265fe5c76&p=8e3ec54ad5c34be413be9b7c5605a5&newp=8b2a975689840eb405bd9b7d0d1ccf231610db2151d4d61f6b82c825d7331b001c3bbfb423231706d8ce766502af4a5ee9f3377237092ba3dda5c91d9fb4c574799b78733f07db&user=baidu&fm=sc&query=RuntimeException%3A+HRegionServer+Aborted&qid=c9c23e7c00016d67&p1=1

你可能感兴趣的:(hbase)