1、下载解压HBase
cd /home/hadoop/app
tar -zxvf hbase-2.4.12-bin.tar.gz
rm hbase-2.4.12-bin.tar.gz
ln -s hbase-2.4.12 hbase
2、修改HBase配置文件
cd /home/hadoop/app/hbase/conf
修改hbase-site.sh
<configuration>
<property>
<name>hbase.zookeeper.quorum</name>
<value>hadoop01,hadoop02,hadoop03</value>
</property>
<property>
<name>hbase.zookeeper.property.dataDir</name>
<value>/home/hadoop/data/zookeeper</value>
</property>
<property>
<name>hbase.zookeeper.property.clientPort</name>
<value>2181</value>
</property>
<property>
<name>hbase.rootdir</name>
<value>hdfs://mycluster/hbase</value>
</property>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
</configuration>
修改regionservers
hadoop01
hadoop02
hadoop03
修改backup-masters
hadoop02
修改hbase-env.sh
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export HBASE_MANAGES_ZK=false
3、配置HBase环境变量
vi ~/.bashrc
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
ZOOKEEPER_HOME=/home/hadoop/app/zookeeper
HADOOP_HOME=/home/hadoop/app/hadoop
HBASE_HOME=/home/hadoop/app/hbase
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
PATH=$JAVA_HOME/bin:$HADOOP_HOME/bin:$ZOOKEEPER_HOME/bin:$HBASE_HOME/bin:$PATH
export JAVA_HOME CLASSPATH HADOOP_HOME ZOOKEEPER_HOME HBASE_HOME
4、将hadoop/etc/hadoop中的core-site.xml和hdfs-site.xml复制到hbase的conf目录下
cp /home/hadoop/app/hadoop/etc/hadoop/core-site.xml /home/hadoop/app/hbase/conf
cp /home/hadoop/app/hadoop/etc/hadoop/hdfs-site.xml /home/hadoop/app/hbase/conf
5、HBase安装目录分发到hadoop02、hadoop03
cd /home/hadoop/app
scp -r hbase-2.4.12 hadoop@hadoop02:/home/hadoop/app
scp -r hbase-2.4.12 hadoop@hadoop03:/home/hadoop/app
ln -s hbase-2.4.12 hbase
6、启动HBase集群
cd /home/hadoop/app/hbase/bin
start-hbase.sh
7、HBase集群状态验证
jps
http://hadoop01:16010和http://hadoop02:16010
|