赞
踩
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> <!-- 指定Zookeeper集群节点 --> <property> <name>hbase.zookeeper.property.dataDir</name> <value>/home/hadoop/data/zookeeper</value> </property> <!-- 指定Zookeeper数据存储目录 --> <property> <name>hbase.zookeeper.property.clientPort</name> <value>2181</value> </property> <!-- 指定Zookeeper端口 --> <property> <name>hbase.rootdir</name> <value>hdfs://mycluster/hbase</value> </property> <!-- 指定HBase在HDFS上的根目录 --> <property> <name>hbase.cluster.distributed</name> <value>true</value> </property> <!-- 指定true为分布式集群部署 --> </configuration>
修改regionservers
#hadoop01、hadoop02、hadoop03都配置为RegionServers
hadoop01
hadoop02
hadoop03
修改backup-masters
hadoop02 #因为HBase的Hmaster为高可用,选择hadoop02为备用节点
修改hbase-env.sh
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export HBASE_MANAGES_ZK=false #使用独立的Zookeeper集群
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 #在hadoop02、hadoop03上生成软连接
6、启动HBase集群
cd /home/hadoop/app/hbase/bin
start-hbase.sh #在hadoop01上启动即可
7、HBase集群状态验证
jps #分别在hadoop01、hadoop02、hadoop03上执行命令,hadoop01和hadoop02上有HMaster和HRegionServer两个进程,hadoop03只有HRegionServer进程
http://hadoop01:16010和http://hadoop02:16010 #一个是Master,一个Backup Master
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。