hbase.rootdir --hbase持久保存的目录
hdfs:192.168.8.101:9000/hbase
hbase.cluster.distributed --是否是分布式
true
hbase.zookeeper.property.clientPort --指定要连接zk的端口
2181
hbase.zookeeper.quorum --指定要连接zk的节点
192.168.8.101
dfs.replication
1
regionservers 192.168.8.101
为了防止因为hbase和hadoop版本不一致而出现的问题,可以看下{hbase_home}/lib/下相关hadoop*.jar的jar包,跟你的hadoop是否是同一个版本,如果不是可以从{hadoop_home}/ share/hadoop/ 下复制
启动hbase(启动的hbase的时候要保证hadoop集群已经启动)
/hbase/bin/start-hbase.sh
查看hbase的进程
[root@node4 bin]# ./start-hbase.sh
localhost: starting zookeeper, logging to /home/zhangxs/hbase/bin/../logs/hbase-root-zookeeper-node4.out
starting master, logging to /usr/local/development/hbase-1.2.4/logs/hbase-node4-master-node4.out
starting regionserver, logging to /usr/local/development/hbase-1.2.4/logs/hbase-node4-1-regionserver-node4.out
[root@node4 bin]# jps
8057 Jps
3166 NodeManager
7830 HRegionServer
2933 SecondaryNameNode
2561 NameNode
5568 QuorumPeerMain
7706 HMaster
3071 ResourceManager
2650 DataNode
5749 GetConf
如果报这个错误是因为用的jdk是1.8的
需要注释掉以下:
配置文件在:文件在 hbase/conf/hbase-env.sh
# Configure PermSize. Only needed in JDK7. You can safely remove it for JDK8+
export HBASE_MASTER_OPTS="$HBASE_MASTER_OPTS -XX:PermSize=128m -XX:MaxPermSize=128m"
export HBASE_REGIONSERVER_OPTS="$HBASE_REGIONSERVER_OPTS -XX:PermSize=128m -XX:MaxPermSize=128m"
没注释以前start-hbase.sh启动后HMaster hregionserver会出现一次.....
输入hbase shell(进入shell命令行)
[root@node4 bin]# hbase shell
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/local/development/hbase-1.2.4/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/development/hadoop-2.6.4/share/hadoop/common/lib/slf4j-log4j12-1.7.5.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.2.4, r67592f3d062743907f8c5ae00dbbe1ae4f69e5af, Tue Oct 25 18:10:20 CDT 2016
hbase(main):001:0>
通过web页面访问hbase