准备工作
hadoop
zookeeper(可选,简单起见不用安装,hbase自带zookeeper功能)
步骤
1、下载解压,
wget https://mirrors.tuna.tsinghua.edu.cn/apache/hbase/2.1.4/hbase-2.1.4-bin.tar.gz
tar zxf hbase-2.1.4-bin.tar.gz -C /usr/local/
建立软链接
cd /usr/local/
ln -s hbase-2.1.4 hbase
2、环境变量
$ vim /etc/profile.d/hbase.sh
export HBASE_HOME=/usr/local/hbase
export PATH=$PATH:$HBASE_HOME/bin
$ source /etc/profile
3、配置文件
修改jdk环境变量,vim /usr/local/hbase/conf/hbase-env.sh
# export JAVA_HOME=/usr/java/jdk1.8.0/
export JAVA_HOME=/usr/local/jdk
修改 vim /usr/local/hbase/conf/hbase-site.xml
先创建目录 mkdir -p /usr/local/hbase/data/zookeeper,用来存放zookeeper的数据
hbase.zookeeper.quorum
192.168.68.128
hbase.zookeeper.property.dataDir
/usr/local/hbase/data/zookeeper
hbase.cluster.distributed
true
hbase.rootdir
hdfs://192.168.68.128:9000/hbase
4、启动hbase
先确保hadoop已经启动
[root@master1] /usr/local/hbase$ jps
16546 NameNode
16643 DataNode
16804 SecondaryNameNode
17003 ResourceManager
17196 NodeManager
17407 Jps
启动hbase
[root@master1] /usr/local/hbase$ start-hbase.sh
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/local/hadoop-2.7.6/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/itaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/hbase-2.1.4/lib/client-facing-thirdparty/slf4j-log4j12-1.7.25.jar!/org/slfpl/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]
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/local/hadoop-2.7.6/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/itaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/hbase-2.1.4/lib/client-facing-thirdparty/slf4j-log4j12-1.7.25.jar!/org/slfpl/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]
192.168.68.128: running zookeeper, logging to /usr/local/hbase/logs/hbase-root-zookeeper-master1.hanli.com.out
192.168.68.128: SLF4J: Class path contains multiple SLF4J bindings.
192.168.68.128: SLF4J: Found binding in [jar:file:/usr/local/hadoop-2.7.6/share/hadoop/common/lib/slf4j-log4j12-1.7.10.org/slf4j/impl/StaticLoggerBinder.class]
192.168.68.128: SLF4J: Found binding in [jar:file:/usr/local/hbase-2.1.4/lib/client-facing-thirdparty/slf4j-log4j12-1.7ar!/org/slf4j/impl/StaticLoggerBinder.class]
192.168.68.128: SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
192.168.68.128: SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
running master, logging to /usr/local/hbase/logs/hbase-root-master-master1.hanli.com.out
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/local/hadoop-2.7.6/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/itaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/hbase-2.1.4/lib/client-facing-thirdparty/slf4j-log4j12-1.7.25.jar!/org/slfpl/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]
: running regionserver, logging to /usr/local/hbase/logs/hbase-root-regionserver-master1.hanli.com.out
: SLF4J: Class path contains multiple SLF4J bindings.
: SLF4J: Found binding in [jar:file:/usr/local/hadoop-2.7.6/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/StaticLoggerBinder.class]
: SLF4J: Found binding in [jar:file:/usr/local/hbase-2.1.4/lib/client-facing-thirdparty/slf4j-log4j12-1.7.25.jar!/org/simpl/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]
验证进程是否完整
[root@master1] /usr/local/hbase$ jps
18240 Jps
16546 NameNode
16643 DataNode
16804 SecondaryNameNode
17721 HQuorumPeer
17929 HRegionServer
17003 ResourceManager
17196 NodeManager
17820 HMaster
访问web界面 http://192.168.68.128:16030