在haoodp-2.7.3 HA的基础上安装Hbase HA

前提安装好hadoop基于QJM的高可用

node1 HMaster
node2 HMaster、HRegionServer
node3 HRegionServer
node4 HRegionServer
node5 HRegionServer

 

1.下载hbase-1.2.3-bin.tar.gz软件

http://www.apache.org/dyn/closer.cgi/hbase/
tar -xvf hbase-1.2.3-bin.tar.gz -C /opt/ #解压到/opt目录

2.修改hbase-env.sh配置文件,添加如下配置

export JAVA_HOME=/opt/jdk1.7.0_79
export HADOOP_HOME=/opt/hadoop-2.7.3
export HBASE_LOG_DIR=/home/hbase/log 自动以日志路径
export HBASE_MANAGES_ZK=false #不使用hbase自带的zookeeper

3.修改hbase-site.xml配置文件,添加如下配置

<configuration>
  <property>
    <name>hbase.rootdir</name>
    <value>hdfs://masters/hbase</value>  #和hadoop配置文件hdfs-site.xml中的dfs.nameservices参数保持一致
  </property>
  <property>
    <name>hbase.cluster.distributed</name>
    <value>true</value>
  </property>
  <property>
    <name>hbase.master.port</name>
    <value>16000</value>  #默认Master的端口
  </property>
  <property>
    <name>hbase.zookeeper.quorum</name>
    <value>node3,node4,node5</value>
  </property>
  <property>
    <name>hbase.zookeeper.property.clientPort</name>
    <value>2181</value>
  </property>
  <property>
    <name>hbase.zookeeper.property.dataDir</name>
    <value>/home/zookeeper</value>
  </property>
  <property>
    <name>hbase.tmp.dir</name>
    <value>/home/hbase/tmp</value>
  </property>

  <property>
    <name>hbase.coprocessor.user.region.classes</name>  #开启Coprocessor
    <value>org.apache.hadoop.hbase.coprocessor.AggregateImplementation</value>
  </property>

  <property>
    <name>hbase.superuser</name>
    <value>hbase,root,hadoop</value>  #超级用户
  </property>

  <property>
    <name>hbase.security.authorization</name>
    <value>true</value>
  </property>

  <property>
    <name>hbase.coprocessor.master.classes</name>
    <value>org.apache.hadoop.hbase.security.access.AccessController</value>
  </property>

  <property>
    <name>hbase.coprocessor.region.classes</name>
    <value>org.apache.hadoop.hbase.security.token.TokenProvider,org.apache.hadoop.hbase.security.access.AccessController</value>
  </property>
</configuration>

4.定义HRegionServer节点,修改配置文件regionservers

node2
node3
node4
node5

5.启动hbase

start-hbase.sh    #在node1上运行
hbase-daemon.sh start master    #在node2上运行

http://node1:16010  #访问web页面,查看各节点服务是否正常运行

 

posted @ 2016-10-19 14:46  侠客书生  阅读(1201)  评论(0编辑  收藏  举报