1.先把hbase-1.3.1-bin.tar上传解压到/usr/local/下重命名为hbase
1 [root@hadoop1 conf]# tail -4 /etc/profile2 ############# hbase env #################3 export HBASE_HOME=/usr/local/hbase4 export PATH=$HBASE_HOME/bin:$PATH
2.配置hbase各配置文件,在一台机器上操作即可
1 [root@hadoop1 ~]# cd /usr/local/hbase/conf/ 2 [root@hadoop1 conf]# vim hbase-env.sh 追加 3 export JAVA_HOME=/usr/java/jdk1.8.0_121 # 你jdk路径 4 export HBASE_MANAGES_ZK=False # 如果没有安装zookeeper,则不需要加 5 [root@hadoop1 conf]# vim hbase-site.xml 67 24 [root@hadoop1 conf]# vim regionservers # 指定集群机器,你的主机名或者ip25 hadoop126 hadoop227 hadoop328 [root@hadoop1 local]# scp -rp /usr/local/hbase/ hadoop2:/usr/local/29 [root@hadoop1 local]# scp -rp /usr/local/hbase/ hadoop3:/usr/local/8 11hbase.rootdir 9hdfs://hadoop1:9000/hbase # hbase的数据存放路径,也就是hdfs1012 15hbase.cluster.distributed 13true # 分布式集群部署1416 19hbase.zookeeper.quorum 17hadoop1,hadoop2,hadoop3 # zookooper安装的机器1820 23hbase.zookeeper.property.dataDir 21/tmp/zookeeper # zookooper的配置、日志路径22
3.启动并验证
1 [root@hadoop1 local]# start-hbase.sh 2 [root@hadoop1 local]# hbase shell # 可进入对应操作页面 3 SLF4J: Class path contains multiple SLF4J bindings. 4 SLF4J: Found binding in [jar:file:/usr/local/hbase/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class] 5 SLF4J: Found binding in [jar:file:/usr/local/hadoop/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class] 6 SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. 7 SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory] 8 HBase Shell 9 Use "help" to get list of supported commands.10 Use "exit" to quit this interactive shell.11 Version 2.0.0-alpha4, r5c4b985f89c99cc8b0f8515a4097c811a0848835, Tue Oct 31 16:00:33 PDT 201712 Took 0.0028 seconds 13 hbase(main):001:0> status # 可查看集群状态14 1 active master, 0 backup masters, 3 servers, 0 dead, 0.6667 average load15 Took 0.3884 seconds
http://ip:16010也可访问