hbase-1.1.3 基于 hadoop-2.6.2 ha 分布式部署

集群说明

    hadoop-2.5.2采用ha方式部署,所有namenode是hdfs://masters,zookeeper地址:bi3:2181,bi4:2181,bi5:2181

IP 主机名 部署
192.168.2.10 bi10 hadoop-2.6.2,HMaster,HRegionServer
192.168.2.12 bi12 hadoop-2.6.2,HMaster,HRegionServer
192.168.2.13 bi13 hadoop-2.6.2

Hbase-1.1.3部署

    解压habse-1.1.3到/home/hadoop/work/hbase-1.1.3

    修改conf/hbase-env.sh,需要HBASE_CLASSPATH=hadoop配置文件位置,否则hbase不能识别hdfs://masters/hbase这种namenode ha的配置方式。

# The java implementation to use.  Java 1.7+ required.
export JAVA_HOME=/home/hadoop/work/jdk1.7.0_75

# Extra Java CLASSPATH elements.  Optional.
export HBASE_CLASSPATH=/home/hadoop/work/hadoop-2.6.2/etc/hadoop

# Tell HBase whether it should manage it's own instance of Zookeeper or not.
export HBASE_MANAGES_ZK=false

    修改conf/hbase-site.xml

<configuration>
  <property>
    <name>hbase.rootdir</name>
    <value>hdfs://masters/hbase</value>
  </property>
  <property>
    <name>hbase.cluster.distributed</name>
    <value>true</value>
  </property>
  <property>
    <name>hbase.master</name>
    <value>60000</value>
  </property>
  <property>
    <name>hbase.zookeeper.quorum</name>
    <value>bi3:2181,bi4:2181,bi5:2181</value>
  </property>
  <property>
    <name>hbase.client.write.buffer</name>
    <value>20971520</value>
  </property>
  <property>
    <name>hbase.zookeeper.property.dataDir</name>
    <value>/home/hadoop/work/hbase-1.1.3/zookeeper/</value>
  </property>
  <property>
    <name>hbase.tmp.dir</name>
    <value>/home/hadoop/work/hbase-1.1.3/tmp/</value>
  </property>
</configuration>

    修改conf/regionservers 

bi10
bi12

    修改~/.bash_profile,增加环境变量

#init hbase_environment
export HBASE_HOME=/home/hadoop/work/hbase-1.1.3
export PATH=$PATH:$HBASE_HOME/bin

 启动habse

    在bi10上启动habse

[hadoop@bi10 hbase-1.1.3]$ start-hbase.sh 
starting master, logging to /home/hadoop/work/hbase-1.1.3/logs/hbase-hadoop-master-bi10.out
bi12: starting regionserver, logging to /home/hadoop/work/hbase-1.1.3/bin/../logs/hbase-hadoop-regionserver-bi12.out
bi10: starting regionserver, logging to /home/hadoop/work/hbase-1.1.3/bin/../logs/hbase-hadoop-regionserver-bi10.out

    在bi12上启动另一个HMaster

[hadoop@bi12 hbase-1.1.3]$ hbase-daemon.sh start master
starting master, logging to /home/hadoop/work/hbase-1.1.3/logs/hbase-hadoop-master-bi12.out

    看下进程,两台主机都应该有HRegionServer,HMaster就对了



你可能感兴趣的:(hbase-1.1.3 基于 hadoop-2.6.2 ha 分布式部署)