Hbase安装及参数说明

来源:互联网 发布:北京超图软件好进吗 编辑:程序博客网 时间:2024/06/07 19:15

1.启动hadoop

start-all.sh 

2.获取并解压HBase安装包

tar -zxvf hbase-0.98.9-hadoop2-bin.tar.gz cd hbase-0.98.9-hadoop2

3.配置conf中的文件

(1)配置hbase-env.sh(修改下面环境语句的路径)

export JAVA_HOME=/usr/local/java/jdk1.7.0_71/

(2)配置hbase-site.xml

<?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="configuration.xsl"?> <configuration>         <property>              <name>hbase.cluster.distributed</name>             <value>true</value>         </property>         <property>              <name>hbase.rootdir</name>              <value>hdfs://cloud01:9000/hbase</value>         </property>         <property>              <name>hbase.zookeeper.quorum</name>              <value>cloud01,cloud02,cloud03</value>         </property> </configuration>

(3)配置regionservers

cloud02cloud03

(4)配置系统文件

sudo gedit /etc/profile

添加配置并生效:

export HBASE_HOME=/home/hduser/hbase-0.98.9-hadoop2 export PATH=$HBASE_HOME/bin:$PATH export HADOOP_CLASSPATH=$HBASE_HOME/lib/*
source /etc/profile

(5)分别拷贝至从节点

cdscp -r hbase-0.98.9-hadoop2 cloud01:~/scp -r hbase-0.98.9-hadoop2 cloud02:~/

(6)在每个从节点重复上面步骤(4)
(7)在cloud01启动hbase

bin/start-hbse.sh

4.配置参数说明:

hbase.regionserver.handler.count

RegionServer接收客户端的请求。
默认值:10

hbase.hregion.max.filesize

在当前ReigonServer上单个Reigon的最大存储空间,单个Region超过该值时,这个Region会被自动split成更小的region。
默认值:256M

hbase.regionserver.global.memstore.upperLimithbase.regionserver.global.memstore.lowerLimit

RegionServer中所有memstore所占java虚拟机的比例。
默认值:0.4/0.35

hbase.hstore.blockingStoreFiles

在compact时,如果一个Store(Coulmn Family)内有超过7个storefile需要合并,则block所有的写请求,进行compact,限制storefile数量增长过快。
默认值:7

hbase.hstore.compaction.min

最少多少个文件可以进行minor compact。默认值:5

hbase.hstore.compaction.max

minor compact一次最多合并多少个文件。默认值:10

hbase.store.compaction.ratio

文件选取中的比例。默认值:1.2

hbase.hstore.compaction.min.size

任何小于这个大小(字节数)的HFile会被自动选为合并对象

hbase.hstore.compaction.max.size

任何大于这个大小(字节数)的HFile会被自动排除作为合并对象

hfile.block.cache.size 

RegionServer的blockcach大小
默认值:0.25

hbase.hregion.memstore.flush.size 

Hregion中MemStore的大小
默认值: 128M

hbase.hregion.majorcompaction

默认值:86400000 毫秒