2 qq513536189 qq513536189 于 2017.01.06 15:05 提问

hbase启动几十秒后,HMaster和HRegionserver自动关闭

master的vim /etc/hostname配置如下

master

master的vim /etc/sysconfig/network配置如下:

# Created by anaconda
NETWORKING=yes
HOSTNAME=master

/etc/hosts配置如下:

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.241.235 master
192.168.241.236 slave1
192.168.241.237 slave2
192.168.241.238 slave3

/etc/profile 增加的配置如下:

78 export JAVA_HOME=/usr/java/jdk1.8.0_112
79 export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
80 export PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin
81
82 export HADOOP_HOME=/root/Hadoop/hadoop-2.7.3
83 export PATH=$PATH:$HADOOP_HOME/bin:$HADOOP_HOME/sbin
84
85 export HBASE_HOME=/root/Hbase/hbase-1.2.4
86 export PATH=$PATH:$HBASE_HOME/bin

regionserver配置如下:

master
slave1
slave2
slave3

hbase-env.sh配置如下:

export JAVA_HOME=/usr/java/jdk1.8.0_112
export HBASE_CLASSPATH=/root/Hadoop/hadoop-2.7.3/etc/hadoop
export HBASE_OPTS="-XX:+UseConcMarkSweepGC"
export HBASE_MANAGES_ZK=true

hbase-site.xml配置如下:

  <configuration>
          <property>
                  <name>hbase.rootdir</name>
                  <value>hdfs://master:9000/hbase</value>
                  <description>hadoop集群地址</description>
          </property>
          <property>
                  <name>hbase.cluster.distributed</name>
                  <value>true</value>
                  <description>是否启动集群模式</description>
          </property>
          <property>
                  <name>hbase.tmp.dir</name>
                  <value>/root/Hbase/hbase-1.2.4/tmp</value>
          </property>
          <property>
                  <name>hbase.master</name> #指定hbase集群主控节点
                  <value>master:60000</value>
          </property>
          <property>
                  <name>hbase.zookeeper.quorum</name>
                  <value>slave1,slave2,slave3</value>
                  <description>zookeeper集群主机名列表</description>
          </property>
          <property>
                  <name>hbase.master.maxclockskew</name>
                  <value>180000</value>
                  <description>Time difference of regionserver from master</description>
          </property>
          <property>
                  <name>hbase.zookeeper.property.dataDir</name>
                  <value>/root/Hbase/hbase-1.2.4/zookeeper_data</value>
          </property>
  </configuration>

logs/hbase-root-master-master部分内容如下:

 2017-01-06 14:35:21,969 INFO  [main] zookeeper.ZooKeeper: Client environment:java.library.path=/root/Hadoop/hadoop-2.7.3/lib/native
2017-01-06 14:35:21,969 INFO  [main] zookeeper.ZooKeeper: Client environment:java.io.tmpdir=/tmp
2017-01-06 14:35:21,969 INFO  [main] zookeeper.ZooKeeper: Client environment:java.compiler=<NA>
2017-01-06 14:35:21,969 INFO  [main] zookeeper.ZooKeeper: Client environment:os.name=Linux
2017-01-06 14:35:21,969 INFO  [main] zookeeper.ZooKeeper: Client environment:os.arch=amd64
2017-01-06 14:35:21,969 INFO  [main] zookeeper.ZooKeeper: Client environment:os.version=3.10.0-514.el7.x86_64
2017-01-06 14:35:21,969 INFO  [main] zookeeper.ZooKeeper: Client environment:user.name=root
2017-01-06 14:35:21,969 INFO  [main] zookeeper.ZooKeeper: Client environment:user.home=/root
2017-01-06 14:35:21,969 INFO  [main] zookeeper.ZooKeeper: Client environment:user.dir=/root/Hbase/hbase-1.2.4/logs
2017-01-06 14:35:21,971 INFO  [main] zookeeper.ZooKeeper: Initiating client connection, connectString=slave1:2181,slave2:2181,slave3:2181 sessionTimeout=90000 watcher=master:160000x0, quorum=slave1:2181,slave2:2181,slave3:2181, baseZNode=/hbase
2017-01-06 14:35:22,048 INFO  [main-SendThread(slave2:2181)] zookeeper.ClientCnxn: Opening socket connection to server slave2/192.168.241.237:2181. Will not attempt to authenticate using SASL (unknown error)
2017-01-06 14:35:22,080 WARN  [main-SendThread(slave2:2181)] zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.NoRouteToHostException: No route to host
    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)
2017-01-06 14:35:22,230 INFO  [main-SendThread(slave1:2181)] zookeeper.ClientCnxn: Opening socket connection to server slave1/192.168.241.236:2181. Will not attempt to authenticate using SASL (unknown error)
2017-01-06 14:35:23,239 WARN  [main-SendThread(slave1:2181)] zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.NoRouteToHostException: No route to host
    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)
2017-01-06 14:35:23,341 INFO  [main-SendThread(slave3:2181)] zookeeper.ClientCnxn: Opening socket connection to server slave3/192.168.241.238:2181. Will not attempt to authenticate using SASL (unknown error)
2017-01-06 14:35:23,342 WARN  [main-SendThread(slave3:2181)] zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.NoRouteToHostException: No route to host
    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)
    ......此处省略N次重复
    Caused by: org.apache.hadoop.hbase.ZooKeeperConnectionException: master:160000x0, quorum=slave1:2181,slave2:2181,slave3:2181, baseZNode=/hbase Unexpected KeeperException creating base node
    at org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher.createBaseZNodes(ZooKeeperWatcher.java:206)
    at org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher.<init>(ZooKeeperWatcher.java:187)
    at org.apache.hadoop.hbase.regionserver.HRegionServer.<init>(HRegionServer.java:585)
    at org.apache.hadoop.hbase.master.HMaster.<init>(HMaster.java:381)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at org.apache.hadoop.hbase.master.HMaster.constructMaster(HMaster.java:2419)
    ... 5 more
Caused by: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase
    at org.apache.zookeeper.KeeperException.create(KeeperException.java:99)
    at org.apache.zookeeper.KeeperException.create(KeeperException.java:51)
    at org.apache.zookeeper.ZooKeeper.create(ZooKeeper.java:783)
    at org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper.createNonSequential(RecoverableZooKeeper.java:565)
    at org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper.create(RecoverableZooKeeper.java:544)
    at org.apache.hadoop.hbase.zookeeper.ZKUtil.createWithParents(ZKUtil.java:1204)
    at org.apache.hadoop.hbase.zookeeper.ZKUtil.createWithParents(ZKUtil.java:1182)
    at org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher.createBaseZNodes(ZooKeeperWatcher.java:194)
    ... 13 more
2017-01-06 14:35:39,329 WARN  [main-SendThread(slave1:2181)] zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.NoRouteToHostException: No route to host
    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)

1个回答

qq513536189
qq513536189   2017.01.10 09:05
已采纳

自问自答:
原因是防火墙没有关闭,我用的是CentOS7,iptables service stop命令在CentOS7上不适用,应改成sudo systemctl stop firewalld.service && sudo systemctl disable firewalld.service

centos从7开始默认用的是firewalld,这个是基于iptables的,虽然有iptables的核心,但是iptables的服务是没安装的。所以你只要停止firewalld服务即可:sudo systemctl stop firewalld.service && sudo systemctl disable firewalld.service

如果你要改用iptables的话,需要安装iptables服务:
sudo yum install iptables-services
sudo systemctl enable iptables && sudo systemctl enable ip6tables
sudo systemctl start iptables && sudo systemctl start ip6tables

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!
其他相关推荐
HMaster和HRegionServer启动后突然消失
在启动HBase的时候master节点的HMaster和Slave节点的HRegionServer启动一段时间后会突然消失。网上搜了一天之后无果,第二天在启动 hadoop的时候发现是hadoop的问题。 问题后来发现是Slave节点的datanode与主节点的? 版本不一致。 hdfs-site.xml中的配置文件如下: dfs.namenode.nam
启动Hbase,HMaster进程可以启动,但是HRegionServer启动不成功
局域网分布式环境测试了一段时间之后,某一天突然重启服务器,发现其他功能可以正常访问,就是图片访问不了,经过初步的判断,认为是hbase引起的,然后就重启hbase,结果发现还是不行,因为在启动的时候,看到HMaster进程已经启动成功了,所以就没有到其他节点查看HRegionServer进程是否启动成功!因为我们局域网的集群都是每天晚上都关一次机的,所以多天下来,服务器的开机和关机的时间的快慢,造
hbase集群部分节点HRegionServer启动后自动关闭的问题
我有四个HRegionServer节点。发现输入./start-hbase.sh后,只启动了两个节点,而且后来两个节点又挂掉了。 查看日志: more hbase-root-regionserver-heres01.log 报错如下: 2017-04-30 14:02:05,999 FATAL [regionserver60020] regionserver.HRegionServer
hbase环境搭建,启动之后HMaster挂掉,或者是集群里,只启动了HMaster节点,HRegionServer节点没有启动的问题
搭建虚拟机的集群,5个节点,结果各种报错,各种坑爹!版本是hbase0.98.13-hadoop2,总结一下问题! 第一:htrace-core的问题! 有2个htrace-core文件,一个是hbase lib下的,一个是hadoop里面的,版本号不一致,开始我还以为这2个是一个文件,然后删除了版本低的,结果就是一启动HMaster节点就自动挂了,然后报了一个.忘记截图了,反正报缺少类了,后
HMaster启动后自动关闭
好久没有来写博客了,总算是忙完了,今天回到阔别已久的CU。一早来到单位,就开始着手调试新测试镜像。但是一启动就出了问题,原先调试好的分布式平台却提示了错误:      Zookeeper available but no active master location found      直观的感觉是HMaster的问题,果然,JPS查看发现没有了HMaster进程,进入到hbase-mast
解决Hbase启动后,hmaster会在几秒钟后自动关闭(停掉)!!!
兜兜转转,尝试了好多种方法,终于是好了,真的是没有度娘解决不了的问题!哈哈哈哈 在日志(身为小白白的我,一开始日志在哪我都不知道!路径:/usr/local/hadoop/app/hbase-0.98.8/logs/hbase-hadoop-master-Master.log(也就是安装hbase下的logs文件夹中))中寻找到错误的原因,如下图: Step 2:运
启动Hbase后Hmaster自动消失问题记录
之前有几次启动Hbase后Hmaster会出现一会后自动消失,经过在网上寻找方法。总结如下:1、可以先删掉zookeeper下自己定义的data文件里的版本信息(当然myid不能删),然后在删掉hdfs里的hbase创建的文件夹。最好在重新格式化下hdfs 格式命令:hdfs namenode -format。如果还是不行的话就删除hadoop安装目录下的tmp文件夹。 做个记录,方便以后使用。
HRegionServer 启动不了,但是HMaster能够启动成功。
Exception in thread "main" java.lang.RuntimeException: Failed construction of Regionserver: class org.apache.hadoop.hbase.regionserver.HRegionServer ... Caused by: java.net.BindException: Problem
Hbase HRegionServer启动后自动关闭
突然发现HBASE无法使用了。 然后看到在分布式的情况下,节点上的HRegionServer启动后自动关闭。 同步时间就能解决这个问题。 网上同步时间 1.  安装ntpdate工具 sudo apt-get install ntpdate 2.  设置系统时间与网络时间同步 sudo ntpdate cn.pool.ntp.org
HBase启动后RegionServer自动挂原因及解决办法【ntp】
前天重新在集群配置了一遍Hbase,./start-hbase.sh后各个节点都运行正常,进入hbase shell之后也能正常的增删查改,高兴了一番。今天再启动发现进行普通的status\list\create操作都会报出Master is initializing的错。然后在各个节点jps后发现所有从点的RegionServer都挂了,主节点的Hmaster还正常运行着。      在从