首页 > 代码库 > hbase搭建

hbase搭建

1、解压

[root@cluster3 conf]# tar -zxvf hbase-0.98.7-hadoop2-bin.tar.gz 

2、环境变量

[root@cluster3 conf]# vi hbase-env.shexport JAVA_HOME=/usr/java/jdk1.7.0_17Hbase日志目录export HBASE_LOG_DIR=/usr/local/hadoop/hbase-0.98.7-hadoop2/logs如果使用HBase自带的Zookeeper值设成true 如果使用自己安装的Zookeeper需要将该值设为falseexport HBASE_MANAGES_ZK=flase

3、修改hbase-site.xml

<configuration>    <property>        <name>hbase.rootdir</name>        <value>hdfs://cluster3:9000/hbase</value>    </property>    <property>        <name>hbase.cluster.distributed</name>        <value>true</value>    </property>    <property>        <name>hbase.cluster3</name>        <value>hdfs://cluster3:60000</value>    </property>    <property>        <name>hbase.zookeeper.property.clientPort</name>        <value>2181</value>    </property>    <property>         <name>hbase.zookeeper.property.dataDir</name>         <value>/usr/local/hadoop/zookeeper-3.4.6/data</value>     </property>     <property>    <property>        <name>hbase.zookeeper.quorum</name>        <value>cluster3,cluster4,cluster5</value>     </property></configuration>

4、修改regionservers

[root@cluster3 conf]# vi regionservers cluster3cluster4cluster5

5、再修改Hadoop hdfs-site.xml下的一个属性值。(记得其他的datanode也要进行修改)

<property>     <name>dfs.datanode.max.xcievers</name>     <value>4096</value> </property>

6、拷贝hbase到所有的节点

[root@cluster3 hadoop]# scp -r ./hbase-0.98.7-hadoop2 root@cluster4:/usr/local/hadoop/[root@cluster3 hadoop]# scp -r ./hbase-0.98.7-hadoop2 root@cluster5:/usr/local/hadoop/

7、启动hbase 

[root@cluster3 bin]# hbase shell2014-11-17 10:03:21,778 INFO  [main] Configuration.deprecation: hadoop.native.lib is deprecated. Instead, use io.native.lib.availableHBase Shell; enter help<RETURN> for list of supported commands.Type "exit<RETURN>" to leave the HBase ShellVersion 0.98.7-hadoop2, r800c23e2207aa3f9bddb7e9514d8340bcfb89277, Wed Oct  8 15:58:11 PDT 2014hbase(main):001:0> listTABLE                                                                           SLF4J: Class path contains multiple SLF4J bindings.SLF4J: Found binding in [jar:file:/usr/local/hadoop/hbase-0.98.7-hadoop2/lib/slf4j-log4j12-1.6.4.jar!/org/slf4j/impl/StaticLoggerBinder.class]SLF4J: Found binding in [jar:file:/usr/local/hadoop/hadoop-2.5.1/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.0 row(s) in 7.3150 seconds=> []hbase(main):002:0> 

8、停止启动

启动顺序1.hadoop2.zookeeper3.hbase停止顺序2.hbase3.zookeeper4.hadoop

 8、jps

[root@cluster3 conf]# jps57207 HQuorumPeer56695 ResourceManager56469 NameNode7407 Jps7217 Main6854 HMaster6988 HRegionServer[root@cluster4 bin]# jps22515 Jps22301 HRegionServer13117 NodeManager22174 QuorumPeerMain[root@cluster5 bin]# jps6911 NodeManager16962 Jps16743 HRegionServer16610 QuorumPeerMain6832 DataNode

 

hbase搭建