安装文档: https://hbase.apache.org/2.1/book.html#standalone_dist
1.下载安装
[root@node1 ~]# wget https://apache.org/dist/hbase/2.0.4/hbase-2.0.4-bin.tar.gz
[root@node1 ~]# tar xvf hbase-2.0.4-bin.tar.gz -C /opt/
[root@node1 conf]# vim hbase-site.xml
hbase.rootdir hdfs://mycluster:8020/hbase --写HDFS地址 hbase.cluster.distributed --开启hbase集群 true hbase.zookeeper.quorum --zookeeper主机名 node1,node2,node3
[root@node1 conf]# vim regionservers --数据节点的主机名
node1
node2
node3
node4
[root@node1 conf]# vim hbase-env.sh
export HBASE_CLASSPATH=/opt/hadoop-2.8.5/etc/hadoop/
export JAVA_HOME=/usr/java/jdk1.8.0_202-amd64/
[root@node1 conf]# cd /opt/
[root@node1 opt]# scp -r /opt/hbase-2.0.4 node2:/opt/
[root@node1 opt]# scp -r /opt/hbase-2.0.4 node3:/opt/
[root@node1 opt]# scp -r /opt/hbase-2.0.4 node4:/opt/
[root@node1 opt]# vim /etc/profile
export HBASE_HOME=/opt/hbase-2.0.4
export PATH=$PATH:$HABSE_HOME/bin
[root@node1 opt]# source /etc/profile
2.启动hbase服务
[root@node1 opt]# cd hbase-2.0.4/bin/
[root@node1 bin]# ./start-hbase.sh
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/opt/hbase-2.0.4/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/opt/hadoop-2.8.5/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]
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/opt/hbase-2.0.4/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/opt/hadoop-2.8.5/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]
node1: running zookeeper, logging to /opt/hbase-2.0.4/bin/../logs/hbase-root-zookeeper-node1.out
node2: running zookeeper, logging to /opt/hbase-2.0.4/bin/../logs/hbase-root-zookeeper-node2.out
node3: running zookeeper, logging to /opt/hbase-2.0.4/bin/../logs/hbase-root-zookeeper-node3.out
running master, logging to /opt/hbase-2.0.4/logs/hbase-root-master-node1.out
node1: running regionserver, logging to /opt/hbase-2.0.4/bin/../logs/hbase-root-regionserver-node1.out
node3: running regionserver, logging to /opt/hbase-2.0.4/bin/../logs/hbase-root-regionserver-node3.out
node4: running regionserver, logging to /opt/hbase-2.0.4/bin/../logs/hbase-root-regionserver-node4.out
node2: running regionserver, logging to /opt/hbase-2.0.4/bin/../logs/hbase-root-regionserver-node2.out
[root@node1 bin]#
3.使用hbase shell命令
[root@node1 bin]# ./hbase shell
HBase Shell
Use "help" to get list of supported commands.
Use "exit" to quit this interactive shell.
For Reference, please visit: http://hbase.apache.org/2.0/book.html#shell
Version 2.0.4, r205e39c5704bf38568b34926dde9f1ee76e6b5d0, Fri Dec 28 22:13:42 PST 2018
Took 0.0048 seconds
hbase(main):001:0> create 't1','q1','w1','e1' --创建t1表
Created table t1
Took 3.0584 seconds
=> Hbase::Table - t1
hbase(main):002:0>
4.web页面访问
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/25854343/viewspace-1394723/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/25854343/viewspace-1394723/