版本:0.94-cdh4.2.1
hbase-site.xml配置
hbase.tmp.dir
- 本地文件系統tmp目錄,一般配置成local模式的設置一下,但是最好還是需要設置一下,因為很多文件都會默認設置成它下面的
- 線上配置
<
property
>
<
name
>hbase.tmp.dir</
name
>
<
value
>/mnt/dfs/11/hbase/hbase-tmp</
value
>
</
property
>
- 默認值:
${java.io.tmpdir}/hbase-${user.name}
hbase.rootdir
- HBase集群中所有RegionServer共享目錄,用來持久化HBase的數據,一般設置的是hdfs的文件目錄,如hdfs://namenode.example.org:9000/hbase
- 線上配置
<
property
>
<
name
>hbase.rootdir</
name
>
<
value
>hdfs://mycluster/hbase</
value
>
</
property
>
- 默認值:
${hbase.tmp.dir}/hbase
hbase.cluster.distributed
- 集群的模式,分布式還是單機模式,如果設置成false的話,HBase進程和Zookeeper進程在同一個JVM進程。
- 線上配置為true
- 默認值:false
hbase.zookeeper.quorum
- zookeeper集群的URL配置,多個host中間用逗號(,)分割
- 線上配置
<
property
>
<
name
>hbase.zookeeper.quorum</
name
> <
value
>inspurXXX.xxx.xxx.org,inspurXXX.xxx.xxx.org,inspurXXX.xxx.xxx.org,inspurXXX.xxx.xxx.org,inspurXXX.xxx.xxx.org</
value
>
</
property
>
- 默認值:localhost
hbase.zookeeper.property.dataDir
- ZooKeeper的zoo.conf中的配置。 快照的存儲位置
- 線上配置:/home/hadoop/zookeeperData
- 默認值:${hbase.tmp.dir}/zookeeper
zookeeper.session.timeout
- 客戶端與zk連接超時時間
- 線上配置:1200000(20min)
- 默認值:180000(3min)
hbase.zookeeper.property.tickTime
- Client端與zk發送心跳的時間間隔
- 線上配置:6000(6s)
- 默認值:6000
hbase.security.authentication
- HBase集群安全認證機制,目前的版本只支持kerberos安全認證。
- 線上配置:kerberos
- 默認值:空
hbase.security.authorization
- HBase是否開啟安全授權機制
- 線上配置: true
- 默認值: false
hbase.regionserver.kerberos.principal
- regionserver的kerberos認證的主體名稱(由三部分組成:服務或用戶名稱、實例名稱以及域名)
- 線上配置:hbase/_HOST@HADOOP.xxx.xxx.COM
- 默認:無
hbase.regionserver.keytab.file
- regionserver keytab文件路徑
- 線上配置:/home/hadoop/etc/conf/hbase.keytab
- 默認值:無
hbase.master.kerberos.principal
- master的kerberos認證的主體名稱(由三部分組成:服務或用戶名稱、實例名稱以及域名)
- 線上配置:hbase/_HOST@HADOOP.xxx.xxx.COM
- 默認:無
hbase.master.keytab.file
- master keytab文件路徑
- 線上配置:/home/hadoop/etc/conf/hbase.keytab
- 默認值:無
hbase.regionserver.handler.count
- regionserver處理IO請求的線程數
- 線上配置:50
- 默認配置:10
hbase.regionserver.global.memstore.upperLimit
- RegionServer進程block進行flush觸發條件:該節點上所有region的memstore之和達到upperLimit*heapsize
- 線上配置:0.45
- 默認配置:0.4
hbase.regionserver.global.memstore.lowerLimit
- RegionServer進程觸發flush的一個條件:該節點上所有region的memstore之和達到lowerLimit*heapsize
- 線上配置:0.4
- 默認配置:0.35
hbase.client.write.buffer
- 客戶端寫buffer,設置autoFlush為false時,當客戶端寫滿buffer才flush
- 線上配置:8388608(8M)
- 默認配置:2097152(2M)
hbase.hregion.max.filesize
- 單個ColumnFamily的region大小,若按照ConstantSizeRegionSplitPolicy策略,超過設置的該值則自動split
- 線上配置:107374182400(100G)
- 默認配置:21474836480(20G)
hbase.hregion.memstore.block.multiplier
- 超過memstore大小的倍數達到該值則block所有寫入請求,自我保護
- 線上配置:8(內存夠大可以適當調大一些,出現這種情況需要客戶端做調整)
- 默認配置:2
hbase.hregion.memstore.flush.size
- memstore大小,當達到該值則會flush到外存設備
- 線上配置:104857600(100M)
- 默認值: 134217728(128M)
hbase.hregion.memstore.mslab.enabled
- 是否開啟mslab方案,減少因內存碎片導致的Full GC,提高整體性能
- 線上配置:true
- 默認配置: true
hbase.regionserver.maxlogs
- regionserver的hlog數量
- 線上配置:128
- 默認配置:32
hbase.regionserver.hlog.blocksize
- hlog大小上限,達到該值則block,進行roll掉
- 線上配置:536870912(512M)
- 默認配置:hdfs配置的block大小
hbase.hstore.compaction.min
- 進入minor compact隊列的storefiles最小個數
- 線上配置:10
- 默認配置:3
hbase.hstore.compaction.max
- 單次minor compact最多的文件個數
- 線上配置:30
- 默認配置:10
hbase.hstore.blockingStoreFiles
- 當某一個region的storefile個數達到該值則block寫入,等待compact
- 線上配置:100(生產環境可以設置得很大)
- 默認配置: 7
hbase.hstore.blockingWaitTime
- block的等待時間
- 線上配置:90000(90s)
- 默認配置:90000(90s)
hbase.hregion.majorcompaction
- 觸發major compact的周期
- 線上配置:0(關掉major compact)
- 默認配置:86400000(1d)
hbase.regionserver.thread.compaction.large
- large compact線程池的線程個數
- 線上配置:5
- 默認配置:1
hbase.regionserver.thread.compaction.small
- small compact線程池的線程個數
- 線上配置:5
- 默認配置:1
hbase.regionserver.thread.compaction.throttle
- compact(major和minor)請求進入large和small compact線程池的臨界點
- 線上配置:10737418240(10G)
- 默認配置:2 * this.minFilesToCompact * this.region.memstoreFlushSize
hbase.hstore.compaction.max.size
- minor compact隊列中storefile文件最大size
- 線上配置:21474836480(20G)
- 默認配置:Long.MAX_VALUE
hbase.rpc.timeout
- RPC請求timeout時間
- 線上配置:300000(5min)
- 默認配置:60000(10s)
hbase.regionserver.region.split.policy
- split操作默認的策略
- 線上配置: org.apache.hadoop.hbase.regionserver.ConstantSizeRegionSplitPolicy(采取老的策略,自己控制split)
- 默認配置: org.apache.hadoop.hbase.regionserver.IncreasingToUpperBoundRegionSplitPolicy(在region沒有達到maxFileSize的前提下,如果fileSize達到regionCount * regionCount * flushSize則進行split操作)
hbase.regionserver.regionSplitLimit
- 單台RegionServer上region數上限
- 線上配置:150
- 默認配置:2147483647
hbase-env.sh配置
指定系統運行環境
export
JAVA_HOME=
/usr/lib/jvm/java-6-sun/
#JDK HOME
export
HBASE_HOME=
/home/hadoop/cdh4/hbase-0
.94.2-cdh4.2.1
# HBase 安裝目錄
export
HBASE_LOG_DIR=
/mnt/dfs/11/hbase/hbase-logs
#日志輸出路徑
|
JVM參數調優
export
HBASE_OPTS="-verbose:gc -XX:+PrintGCDetails -Xloggc:${HBASE_LOG_DIR}
/hbase-gc
.log -XX:+PrintGCTimeStamps -XX:+PrintGCApplicationConcurrentTime -XX:+PrintGCApplicationStoppedTime \
-server -Xmx20480m -Xms20480m -Xmn10240m -Xss256k -XX:SurvivorRatio=4 -XX:MaxPermSize=256m -XX:MaxTenuringThreshold=15 \
-XX:ParallelGCThreads=16 -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:CMSFullGCsBeforeCompaction=5 -XX:+UseCMSCompactAtFullCollection \
-XX:+CMSClassUnloadingEnabled -XX:CMSInitiatingOccupancyFraction=70 -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSMaxAbortablePrecleanTime=5000 \
"
|