HBase Flush 機制


定義在 hbase-site.xml 文件

## Count of RPC Listener instances spun up on RegionServers
## 一個 region server 可以同時處理的請求個數 (包括增刪查改), 超過這個值的請求會在 Queue 里排隊
hbase.regionserver.handler.count : 30


## 以下幾個參數是關於 MemStore 刷入 HFile 的機制
##   1. MemStore 超過 128M 時刷入 (默認每 10 秒檢查一次)
##   2. MemStore 超過 4 * 128M 時 block 更新 MemStore 的操作,並強制做 flush,這是為了處理出現 spike 的場景
##   3. 當 RegionServer 所有 MemStore 的總大小超過 RegionServer 的 heap 的 40% 時,
##      會 block 所有更新 MemStore 的操作,並強制做 flush,從占內存大的 MemStore 開始
##   4. 當 RegionServer 所有 MemStore 的總大小超過 RegionServer 的 heap 的 40% * 0.95 時,
##      選擇占用內存大的 MemStore 阻塞更新操作,並進行 flush
##   5. 當 WAL(Write-ahead log,預寫日志) 數量,也就是 HLog 文件數據大於 32 時,
##      會進行 flush,從最舊的 HLog 文件對應的 Region 開始
##   6. Region 的數據更新超過一定閾值 (30 millions) 時 flush
##   7. 定期 (1 小時) 進行 flush
##   8. 也可以手動刷入,HBase shell -> flush "TableName"

## if a MemStore exceed 128M, flush to HDFS HFile
## can flush in hbase shell manaully : flush 'TABLENAME'
hbase.hregion.memstore.flush.size : 134217728 (128M)

## block update(write,insert,delete) action if a MemStore exceed flush.size*multiplier, for spike traffic scenario
## throw RegionTooBusyException
hbase.hregion.memstore.block.multiplier : 4

## Maximum size of all memstores in a region server before new updates are blocked and flushes are forced
hbase.regionserver.global.memstore.size : 0.4

## Maximum size of all memstores in a region server before flushes are forced
hbase.regionserver.global.memstore.size.lower.limit : 95% of hbase.regionserver.global.memstore.size

## If more than this many logs, force flush of oldest region to oldest edit goes to disk. 
hbase.regionserver.maxlogs : 32

## force a flush if there are already enough changes for one region in memstore
hbase.regionserver.flush.per.changes : 30000000

## Maximum amount of time an edit lives in memory before being automatically flushed
hbase.regionserver.optionalcacheflushinterval : 3600000 (1 hour)


## Maximum HStoreFile size in HDFS
## hadoop fs -du -s -h /apps/hbase/data/data/default/REGULARDATAPHOENIXTABLE/*
hbase.hregion.max.filesize : 10737418240 (10G)
          
## The time (in miliseconds) between 'major' compactions of all HStoreFiles in a region
## 多久做一次 major compact
hbase.hregion.majorcompaction : 604800000 (7 days)

## Max number of HStoreFiles to compact per 'minor' compaction
## 一次 minor compact 最多操作多少個 HFile
hbase.hstore.compaction.max : 10



免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM