Big Data Cluster Construction-"Highly Available Habse"-Cainiao Xiaohui
Summary:
Big data cluster construction (zookeeper, high-availability hadoop, high-availability hbase)
Continued from the previous chapter:
big data cluster construction-"high-availability hadoop chapter"
Four, Hbase cluster construction
- Ensure that the first two configurations are correct (or configure the zhiyou001 host first and then copy)
- create:
mkdir -p /opt/hbase
- enter:
cd /opt/hbase
- Upload:
- Unzip:
tar -zxvf hbase-2.0.0-bin.tar.gz
- Modify hbase-env.sh
cd /opt/hbase/hbase-2.0.0/conf/
vi hbase-env.sh
//去掉注释并修改
export JAVA_HOME=/opt/java/jdk1.8.0_141
export HBASE_MANAGES_ZK=false
- Modify hbase-site.xml
vi hbase-site.xml
//添加如下:
<!-- 指定hbase在HDFS上存储的路径 -->
<property>
<name>hbase.rootdir</name>
<value>hdfs://ns/hbase</value>
</property>
<!-- 指定hbase是分布式的 -->
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
<!-- 指定zk的地址,多个用“,”分割 -->
<property>
<name>hbase.zookeeper.quorum</name>
<value>zhiyou001:2181,zhiyou002:2181,zhiyou003:2181</value>
</property>
<property>
<name>hbase.master.maxclockskew</name>
<value>150000</value>
</property>
<property>
<name>hbase.master.info.port</name>
<value>60010</value>
</property>
- there regionservers
//losthost换为:
zhiyou001
zhiyou002
zhiyou003
- Copy the hadoop configuration files hdfs-site.xml and core-site.xml to hbase conf
cp /opt/hadoop/hadoop-2.7.3/etc/hadoop/hdfs-site.xml /opt/hbase/hbase-2.0.0/conf/
cp /opt/hadoop/hadoop-2.7.3/etc/hadoop/core-site.xml /opt/hbase/hbase-2.0.0/conf/
- Send files to two other hosts
scp -r /opt/hbase/ root@zhiyou002:/opt/hbase/
scp -r /opt/hbase/ root@zhiyou003:/opt/hbase/
- Synchronize system time (three sets at the same time)
//安装ntpdate
yum install -y ntp
ntpdate ntp.api.bz
- start up
//启动zookeeper(三台)
cd /opt/zookeeper/zookeeper-3.4.12/bin/
./zkServer.sh start
//启动hadoop(三台)
/opt/hadoop/hadoop-2.7.3/sbin/
./start-all.sh
//Hbase(只要在主节点启动就可以了)
cd /opt/hbase/hbase-2.0.0/bin/
./start-hbase.sh
- Access through the browser (three host configuration completed):
zhiyou001:60010