码迷,mamicode.com
首页 > 其他好文 > 详细

hbase搭建

时间:2014-11-17 11:59:48      阅读:235      评论:0      收藏:0      [点我收藏+]

标签:des   style   blog   http   io   color   ar   使用   sp   

1、解压

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

2、环境变量

[root@cluster3 conf]# vi hbase-env.sh
export JAVA_HOME=/usr/java/jdk1.7.0_17
Hbase日志目录
export HBASE_LOG_DIR=/usr/local/hadoop/hbase-0.98.7-hadoop2/logs
如果使用HBase自带的Zookeeper值设成true 如果使用自己安装的Zookeeper需要将该值设为false
export 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 

cluster3
cluster4
cluster5

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 shell
2014-11-17 10:03:21,778 INFO  [main] 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.98.7-hadoop2, r800c23e2207aa3f9bddb7e9514d8340bcfb89277, Wed Oct  8 15:58:11 PDT 2014

hbase(main):001:0> list
TABLE                                                                           
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.hadoop
2.zookeeper
3.hbase

停止顺序
2.hbase
3.zookeeper
4.hadoop

 8、jps

[root@cluster3 conf]# jps
57207 HQuorumPeer
56695 ResourceManager
56469 NameNode
7407 Jps
7217 Main
6854 HMaster
6988 HRegionServer


[root@cluster4 bin]# jps
22515 Jps
22301 HRegionServer
13117 NodeManager
22174 QuorumPeerMain

[root@cluster5 bin]# jps
6911 NodeManager
16962 Jps
16743 HRegionServer
16610 QuorumPeerMain
6832 DataNode

 

hbase搭建

标签:des   style   blog   http   io   color   ar   使用   sp   

原文地址:http://www.cnblogs.com/huanhuanang/p/4103013.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!