【错误】The node /hbase is not in ZooKeeper,Hbase端口占用无法正常启动

来源:互联网 发布:大学生网络兼职有哪些 编辑:程序博客网 时间:2024/05/16 06:32

本人在启动zookeeper后,又启动HDFS,最后启动Hbase的时候,发现JPS进程中不显示HMaster进程,如下:

[hadoop@hadoop000 bin]$ jps3936 NameNode4241 SecondaryNameNode6561 Jps4041 DataNode3418 QuorumPeerMain

然后./hbase shell,发现出现下面的错误:


这是我之前的hbase-site.xml配置文件:


另外,我的hbase-env.sh中export HBASE_MANAGES_ZK=true 设置已经更改成了false,java路径也设置对了,下面是zookeeper中的zoo.cfg:

# The number of milliseconds of each ticktickTime=2000# The number of ticks that the initial # synchronization phase can takeinitLimit=10# The number of ticks that can pass between # sending a request and getting an acknowledgementsyncLimit=5# the directory where the snapshot is stored.# do not use /tmp for storage, /tmp here is just # example sakes.dataDir=/home/hadoop/app/tmp/zk# the port at which the clients will connectclientPort=2181## Be sure to read the maintenance section of the # administrator guide before turning on autopurge.## http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance## The number of snapshots to retain in dataDir#autopurge.snapRetainCount=3# Purge task interval in hours# Set to "0" to disable auto purge feature#autopurge.purgeInterval=1
 查找不到原因,然后查看hbase/log中的log文件,发现了这条错误信息:

2017-11-17 12:01:24,469 INFO  [main] server.ZooKeeperServer: Server environment:user.dir=/home/hadoop/app/hbase-1.2.0-cdh5.7.0/bin2017-11-17 12:01:24,477 INFO  [main] server.ZooKeeperServer: Created server with tickTime 2000 minSessionTimeout 4000 maxSessionTimeout 40000 datadir /tmp/hbase-hadoop/zookeeper/zookeeper_0/version-2 snapdir /tmp/hbase-hadoop/zookeeper/zookeeper_0/version-22017-11-17 12:01:24,485 INFO  [main] server.NIOServerCnxnFactory: binding to port 0.0.0.0/0.0.0.0:21812017-11-17 12:01:24,486 INFO  [main] server.NIOServerCnxnFactory: binding to port 0.0.0.0/0.0.0.0:21822017-11-17 12:01:24,490 INFO  [main] persistence.FileSnap: Reading snapshot /tmp/hbase-hadoop/zookeeper/zookeeper_0/version-2/snapshot.962017-11-17 12:01:24,501 INFO  [main] persistence.FileTxnSnapLog: Snapshotting: 0x96 to /tmp/hbase-hadoop/zookeeper/zookeeper_0/version-2/snapshot.962017-11-17 12:01:24,558 INFO  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2182] server.NIOServerCnxnFactory: Accepted socket connection from /127.0.0.1:576112017-11-17 12:01:24,562 INFO  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2182] server.NIOServerCnxn: Processing stat command from /127.0.0.1:576112017-11-17 12:01:24,564 INFO  [Thread-2] server.NIOServerCnxn: Stat command output2017-11-17 12:01:24,564 INFO  [main] zookeeper.MiniZooKeeperCluster: Started MiniZooKeeperCluster and ran successful 'stat' on client port=21822017-11-17 12:01:24,565 ERROR [main] master.HMasterCommandLine: Master exitingjava.io.IOException: Could not start ZK at requested port of 2181.  ZK was started at port: 2182.  Aborting as clients (e.g. shell) will not be able to find this ZK quorum.at org.apache.hadoop.hbase.master.HMasterCommandLine.startMaster(HMasterCommandLine.java:213)at org.apache.hadoop.hbase.master.HMasterCommandLine.run(HMasterCommandLine.java:138)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.master.HMaster.main(HMaster.java:2446)2017-11-17 12:01:24,566 INFO  [Thread-2] server.NIOServerCnxn: Closed socket connection for client /127.0.0.1:57611 (no session established for client)

由于之前启动的zookeeper已经占用了2181端口,我不敢kill掉这个进程,但看提示是hbase需要在这个端口启动,我开始以为是hbase开启了自带的zookeeper与我外置打开的zookeeper冲突,在网上也找了很多方法,改了各种hbase-site.xml配置文件,但是还是不行, ZK was started at port: 2182,跟据这提示,我最后把hbase-site.xml中的2181端口改成了2182,成功启动了HMaster进程。./hbase shell命令也能正常使用。运行结果如下:



阅读全文
0 0
原创粉丝点击