master.HMasterCommandLine: Master exiting

2018-08-20 00:59:33,382 ERROR [main] master.HMasterCommandLine: Master exiting
java.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:217)
	at org.apache.hadoop.hbase.master.HMasterCommandLine.run(HMasterCommandLine.java:140)
	at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
	at org.apache.hadoop.hbase.util.ServerCommandLine.doMain(ServerCommandLine.java:149)
	at org.apache.hadoop.hbase.master.HMaster.main(HMaster.java:2983)

原因是单机版hbase自带zookeeper,本地zookeeper启动会占用默认端口,因此启动不成功

修改配置文件:vim /export/servers/hbase-2.1.0/conf/hbase-env.sh

export JAVA_HOME=/export/server/jdk1.8.0_171
export HBASE_MANAGES_ZK=true(开启hbase自带zookepper)

***********************************************************************************************
    
原因是单机版hbase自带zookeeper,本地zookeeper启动会占用默认端口,因此启动不成功

Hbase单机版

解压:tar -xvf hbase-2.1.0-bin.tar.gz -C /export/servers/

进入:cd /export/servers/hbase-2.1.0/

删除文档:rm -rf docs

#配置环境变量
vim /etc/profile
export HBASE_HOME=/export/servers/hbase-2.1.0
export PATH=${HBASE_HOME}/bin:$PATH

#修改配置文件
cd /export/servers/hbase-2.1.0/conf/
vim hbase-env.sh

export JAVA_HOME=/export/servers/jdk1.8.0_171
export HBASE_MANAGES_ZK=true(开启hbase自带zookepper,否则启动异常)

vim hbase-site.xml
---- 输入如下内容 ---- 

 
    hbase.rootdir
     
    file:///export/data/hbase
 

 
    hbase.zookeeper.property.dataDir
   
    /export/data/zookeeper/
 

 
    hbase.unsafe.stream.capability.enforce
       
    false
 

手动生成文件路径:mkdir -p /export/data/hbase

start-hbase.sh
启动成功后访问页面:http://node01:16010/

***********************************************************************************************

集群搭建

先觉条件:集群部署需要ZooKeeper和HDFS的支持,必须保证这两项服务已经存在

修改Hbase的配置文件:

第一步,修改hbase-env.sh
export JAVA_HOME=/export/servers/jdk1.8.0_171

#自己不维护ZooKeeper,需要外部配置
export HBASE_MANAGES_ZK=false

第二步,修改hbase-site.xml

 
    hbase.rootdir
    hdfs://node01:9000/hbase
 

 
     hbase.cluster.distributed
     true
 

 
    hbase.zookeeper.property.dataDir
    /export/data/hbase/zookeeper/
 

 
    hbase.zookeeper.quorum
    node01,node02,node03
 

 
    hbase.zookeeper.property.clientPort
    2181
 

 
    hbase.unsafe.stream.capability.enforce
       
    true
 

第三步,修改regionservers

node01
node02
node03

第四步,分发到node02、node03

cd /export/servers
scp -r hbase-2.1.0 node02:/export/servers/
scp -r hbase-2.1.0 node03:/export/servers/

scp /etc/profile node02:/etc/
scp /etc/profile node03:/etc/

#分别到node02、node03执行
source /etc/profile

第五步,启动:

start-hbase.sh

注意:如果第一次搭建出现问题,需要删除zookeeeper中版本信息,即VERSION-2

你可能感兴趣的:(master.HMasterCommandLine: Master exiting)