CentOS 7
hadoop 2.7.3 CentOS 7.0安装flume
hbase 1.3.1
zookeeper 3.4.11 CentOS 7.0安装flume
下载链接:https://mirrors.tuna.tsinghua.edu.cn/apache/hbase/
百度云链接:https://pan.baidu.com/s/1i4HTwVz 密码:p7k3
上传已下载的hbase压缩包到/data/software 目录
mkdir -p /opt/hbase
cd /data/software
tar -zxvf hbase-1.3.1-bin.tar.gz -C /opt/hbase/
cd /opt/hbase/hbase-1.3.1
mkdir logs
修改/etc/profile文件,添加上zookeeper和hbase的环境变量
vi /etc/profile
export ZK_HOME=/opt/zookeeper/zookeeper-3.4.11
export HBASE_HOME=/opt/hbase/hbase-1.3.1
export PATH=$PATH:$JAVA_HOME/bin:$HADOOP_HOME/bin:$HIVE_HOME/bin:$ZK_HOME/bin:$HBASE_HOME/bin
source /etc/profile
cp hbase-env.sh hbase-env.sh.bak
vi hbase-env.sh
添加上以下内容:
export JAVA_HOME=/opt/java/jdk1.8.0_60
export HADOOP_HOME=/opt/hadoop/hadoop-2.7.3
export HBASE_HOME=/opt/hbase/hbase-1.3.1
export HBASE_CLASSPATH=/opt/hadoop/hadoop-2.7.3/etc/hadoop
export HBASE_MANAGES_ZK=false
export HBASE_PID_DIR=/root/hbase/pids
由于需要在配置文件中指定一些目录,需要先创建临时目录
mkdir -p /root/hbase/tmp
mkdir -p /root/hbase/pids
修改hbase-site.xml文件内容,在标签中添加如下内容
<property>
<name>hbase.rootdirname>
<value>hdfs://master:9000/hbasevalue>
<description>The directory shared byregion servers.description>
property>
<property>
<name>hbase.zookeeper.property.clientPortname>
<value>2181value>
<description>Property from ZooKeeper'sconfig zoo.cfg. The port at which the clients will connect.
description>
property>
<property>
<name>zookeeper.session.timeoutname>
<value>120000value>
property>
<property>
<name>hbase.zookeeper.quorumname>
<value>master,slave1,slave2value>
property>
<property>
<name>hbase.tmp.dirname>
<value>/root/hbase/tmpvalue>
property>
<property>
<name>hbase.cluster.distributedname>
<value>truevalue>
property>
vi regionservers
删除已存在的localhost
master
slave1
slave2
cd /opt/hbase/hbase-1.3.1/bin
./start-hbase.sh
输出:
starting master, logging to /opt/hbase/hbase-1.3.1/logs/hbase-root-master-master.out
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=128m; support was removed in 8.0
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0
slave1: starting regionserver, logging to /opt/hbase/hbase-1.3.1/logs/hbase-root-regionserver-slave1.out
slave2: starting regionserver, logging to /opt/hbase/hbase-1.3.1/logs/hbase-root-regionserver-slave2.out
master: starting regionserver, logging to /opt/hbase/hbase-1.3.1/logs/hbase-root-regionserver-master.out
查看进程:
# master
39842 ResourceManager
52325 QuorumPeerMain
39545 SecondaryNameNode
60505 HRegionServer
60697 Jps
60346 HMaster
39213 NameNode
# slave1
45738 DataNode
5339 QuorumPeerMain
12827 HRegionServer
120396 NodeManager
13071 Jps
# slave2
4593 QuorumPeerMain
45003 DataNode
119466 NodeManager
11787 Jps
11532 HRegionServe
说明:在启动hbase之前,确保hadoop已经启动,由于已经配置了export HBASE_MANAGES_ZK=false
,表示我们不使用hbase自带的zookeeper,所以我们还要先启动已安装的zookeeper。
启动顺序:hadoop–zookeeper–hbase
通过浏览器访问192.168.122.128:16030
、192.168.122.129:16030
、192.168.122.130:16030
,页面可以看到hbase的状态信息
启动hbase的shell命令行
./hbase shell
输出:
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/opt/hbase/hbase-1.3.1/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/opt/hadoop/hadoop-2.7.3/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
HBase Shell; enter 'help' for list of supported commands.
Type "exit" to leave the HBase Shell
Version 1.3.1, r930b9a55528fe45d8edce7af42fef2d35e77677a, Thu Apr 6 19:36:54 PDT 2017
hbase(main):001:0>
查看hbase状态
status
输出:
hbase(main):001:0> status
1 active master, 0 backup masters, 3 servers, 0 dead, 0.6667 average load
退出hbase shell
exit
说明: 在hbase命令行状态下,退格键为Ctrl+Backspace
至此,hbase已安装完成
参考:
Linux安装Hbase(CentOS7+Hbase1.2.5+Hadoop2.8.0)
CentOS7搭建Hadoop + HBase + Zookeeper集群