标签:
1.hbase下载(本文hadoop版本使用2.5.2,Hbase版本使用1.1.2)
下载地址:http://apache.fayea.com/hbase/
2.JDK版本支持
HBase Version | JDK 6 | JDK 7 | JDK 8 |
1.2 | Not Supported | yes | yes |
1.1 | Not Supported | yes | Running with JDK 8 will work but is not well tested. |
1 | Not Supported | yes | Running with JDK 8 will work but is not well tested. |
0.98 | yes | yes | Running with JDK 8 will work but is not well tested. |
0.94 | yes | yes | N/A |
3.hadoop版本支持
HBase-0.94.x | HBase-0.98.x | HBase-1.0.x | HBase-1.1.x | HBase-1.2.x | |
Hadoop-1.0.x | X | X | X | X | X |
Hadoop-1.1.x | S | NT | X | X | X |
Hadoop-0.23.x | S | X | X | X | X |
Hadoop-2.0.x-alpha | NT | X | X | X | X |
Hadoop-2.1.0-beta | NT | X | X | X | X |
Hadoop-2.2.0 | NT | S | NT | NT | NT |
Hadoop-2.3.x | NT | S | NT | NT | NT |
Hadoop-2.4.x | NT | S | S | S | S |
Hadoop-2.5.x | NT | S | S | S | S |
Hadoop-2.6.x | X | X | X | X | X |
Hadoop-2.7.0 | X | X | X | X | X |
Hadoop-2.7.1+ | NT | NT | NT | NT | S |
4.安装Hbase
解压安装文件即可
[root@wap usr]# tar -zxvf hbase-1.1.2-bin.tar.gz
5.单点模式配置
修改配置hbase-env.sh
[root@wap conf]# vi /usr/hbase-1.1.2/conf/hbase-env.sh # The java implementation to use. Java 1.7+ required. # export JAVA_HOME=/usr/java/jdk1.6.0/ export JAVA_HOME=/usr/java/jdk1.7.0_79
配置hbase-site.xml(hbase.rootdir的默认值是temp目录,linux重启后会清空此目录)
<configuration> <property> <name>hbase.rootdir</name> <value>file:///user/hbase/data</value> </property> </configuration>
启动Hbase,使用jps查看进程。存在HMaster说明Hbase已经启动成功。
[root@wap bin]# start-hbase.sh
starting master, logging to /usr/hbase-1.1.2/bin/../logs/hbase-root-master-wap.out
[root@wap bin]# jps
1745 -- process information unavailable
441 DataNode
8936 Jps
310 NameNode
755 ResourceManager
862 NodeManager
604 SecondaryNameNode
8851 HMaster
31222 Resin
31190 WatchdogManager
进入shell,如下:
[root@wap bin]# hbase shell SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/usr/hbase-1.1.2/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/usr/hadoop2/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] 2015-12-18 15:39:43,750 WARN [main] util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable HBase Shell; enter ‘help<RETURN>‘ for list of supported commands. Type "exit<RETURN>" to leave the HBase Shell Version 1.1.2, rcc2b70cf03e3378800661ec5cab11eb43fafe0fc, Wed Aug 26 20:11:27 PDT 2015 hbase(main):001:0>
6.伪分布模式配置
在hbase-env.sh中继续添加HBASE_CLASSPATH环境变量
vi /usr/hbase-1.1.2/conf/hbase-env.sh
# The java implementation to use. Java 1.7+ required. # export JAVA_HOME=/usr/java/jdk1.6.0/ export JAVA_HOME=/usr/java/jdk1.7.0_79 # Extra Java CLASSPATH elements. Optional. # export HBASE_CLASSPATH= HBASE_CLASSPATH=/usr/hadoop2/etc/hadoop
配置hbase-site.xml打开分布模式
<configuration> <property> <name>hbase.rootdir</name> <value>file:///user/hbase/data</value> </property> <property> <name>hbase.cluster.distributed</name> <value>true</value> </property> </configuration>
启动Hbase,使用jps查看进程。存在HMaster说明Hbase已经启动成功。
[root@wap bin]# start-hbase.sh localhost: starting zookeeper, logging to /usr/hbase-1.1.2/bin/../logs/hbase-root-zookeeper-wap.out starting master, logging to /usr/hbase-1.1.2/bin/../logs/hbase-root-master-wap.out starting regionserver, logging to /usr/hbase-1.1.2/bin/../logs/hbase-root-1-regionserver-wap.out [root@wap bin]# jps 1745 -- process information unavailable 441 DataNode 10473 HMaster 10754 Jps 310 NameNode 755 ResourceManager 10591 HRegionServer 10405 HQuorumPeer 862 NodeManager 604 SecondaryNameNode 31222 Resin 31190 WatchdogManager [root@wap bin]#
7.完全分布模式配置
标签:
原文地址:http://www.cnblogs.com/jackgaolei/p/5056856.html