使用最新的Hadoop集群与HBase搭建一个分布式的运行环境,最新的Hadoop稳定版本是2.2.0,HBase 的稳定版本是0.94.14 ,搭建过程如下:
这个步骤,我的blog hadoop集群安装
HBase 可以用3个模式之一来安装,分别是:
@@ -1034,7 +1034,7 @@ <slf4j.version>1.4.3</slf4j.version> <log4j.version>1.2.16</log4j.version> <mockito-all.version>1.8.5</mockito-all.version> - <protobuf.version>2.4.0a</protobuf.version> + <protobuf.version>2.5.0</protobuf.version> <stax-api.version>1.0.1</stax-api.version> <thrift.version>0.8.0</thrift.version> <zookeeper.version>3.4.5</zookeeper.version> @@ -2241,7 +2241,7 @@ </property> </activation> <properties> - <hadoop.version>2.0.0-alpha</hadoop.version> + <hadoop.version>2.2.0</hadoop.version> <slf4j.version>1.6.1</slf4j.version> </properties> <dependencies>
HBase-0.92.x | HBase-0.94.x | HBase-0.96.0 | HBase-0.98.0 | |
---|---|---|---|---|
Hadoop-0.20.205 | S | X | X | X |
Hadoop-0.22.x | S | X | X | X |
Hadoop-1.0.0-1.0.2[a] | S | S | X | X |
Hadoop-1.0.3+ | S | S | S | X |
Hadoop-1.1.x | NT | S | S | X |
Hadoop-0.23.x | X | S | NT | X |
Hadoop-2.0.x-alpha | X | NT | X | X |
Hadoop-2.1.0-beta | X | NT | S | X |
Hadoop-2.2.0 | X | NT[b] | S | S |
Hadoop-2.x | X | NT | S | S |
Where
S = supported and tested, |
X = not supported, |
NT = it should run, but not tested enough. |
mvn clean install assembly:single -Dhadoop.profile=2.0 -DskipTests
vim hbase-env.sh export JAVA_HOME=your_java_home export HBASE_MANAGES_ZK=false
<configuration> <property> <name>hbase.rootdir</name> <value>hdfs://hadoop-master:9000/hbase</value> <description>The directory shared by region servers.</description> </property> <property> <name>hbase.cluster.distributed</name> <value>true</value> <description>The mode the cluster will be in. Possible values are false: standalone and pseudo-distributed setups with managed Zookeeper true: fully-distributed with unmanaged Zookeeper Quorum (see hbase-env.sh) </description> </property> <property> <name>hbase.zookeeper.property.clientPort</name> <value>2222</value> <description>Property from ZooKeeper's config zoo.cfg. The port at which the clients will connect. </description> </property> <property> <name>hbase.zookeeper.quorum</name> <value>machine-0,machine-1,machine-2</value> <description>Comma separated list of servers in the ZooKeeper Quorum. For example, "host1.mydomain.com,host2.mydomain.com". By default this is set to localhost for local and pseudo-distributed modes of operation. For a fully-distributed setup, this should be set to a full list of ZooKeeper quorum servers. If HBASE_MANAGES_ZK is set in hbase-env.sh this is the list of servers which we will start/s top ZooKeeper on. </description> </property> </configuration>
#machine-0 scp -r /opt/hbase machine-0:/opt/ #machine-1 scp -r /opt/hbase machine-1:/opt/ #machine-2 scp -r /opt/hbase machine-2:/opt/
#注意,首先要启动Hadoo集群 /opt/hbase/bin/start-hbase.sh
[app@hadoop-master ~]$ hbase shell 14/01/10 20:19:33 INFO Configuration.deprecation: hadoop.native.lib is deprecated. Instead, use io.native.lib.available HBase Shell; enter 'help<RETURN>' for list of supported commands. Type "exit<RETURN>" to leave the HBase Shell Version 0.94.14, rUnknown, Wed Jan 8 04:02:25 EST 2014 hbase(main):001:0> list TABLE SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/opt/hbase/lib/slf4j-log4j12-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/opt/hadoop/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. car weblogs 2 row(s) in 3.1790 seconds