加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

HBase 用脚本怎么获取热点Region 并且MOVE

(2018-01-15 13:53:56)
标签:

hbase

move

region

regionserver

分类: 大数据
HBase 用脚本怎么获取热点Region

Hbase通过web管理界面点击region server -> Metirc 可以看到各个表的访问量统计
有的时候我们想要通过命令行脚本获取这个数,那么有没有办法可以通过cli获取这个呢
查了资料,hbase邮件组建议通过 detail status来获取如下

$ echo "status 'detailed'"|hbase shell -n|grep -B1 readRequestsCount
    ip-172-31-7-85.cn-north-1.compute.internal:16020 1515384667443
        requestsPerSecond=0.0, numberOfOnlineRegions=2, usedHeapMB=61, maxHeapMB=5726, numberOfStores=3, numberOfStorefiles=2, storefileUncompressedSizeMB=0, storefileSizeMB=0, memstoreSizeMB=0, storefileIndexSizeMB=0, readRequestsCount=10, writeRequestsCount=4, rootIndexSizeKB=0, totalStaticIndexSizeKB=0, totalStaticBloomSizeKB=0, totalCompactingKVs=0, currentCompactedKVs=0, compactionProgressPct=NaN, coprocessors=[]
        "hbase:namespace,,1515384777945.f09d1b06b16ed936cc338b0797b8d332."
            numberOfStores=1, numberOfStorefiles=1, storefileUncompressedSizeMB=0, lastMajorCompactionTimestamp=0, storefileSizeMB=0, memstoreSizeMB=0, storefileIndexSizeMB=0, readRequestsCount=0, writeRequestsCount=0, rootIndexSizeKB=0, totalStaticIndexSizeKB=0, totalStaticBloomSizeKB=0, totalCompactingKVs=0, currentCompactedKVs=0, compactionProgressPct=NaN, completeSequenceId=-1, dataLocality=0.0
        "member,,1515471633826.1ce5d5d93b933e78908436da444887e0."
            numberOfStores=2, numberOfStorefiles=1, storefileUncompressedSizeMB=0, lastMajorCompactionTimestamp=0, storefileSizeMB=0, memstoreSizeMB=0, storefileIndexSizeMB=0, readRequestsCount=10, writeRequestsCount=4, rootIndexSizeKB=0, totalStaticIndexSizeKB=0, totalStaticBloomSizeKB=0, totalCompactingKVs=0, currentCompactedKVs=0, compactionProgressPct=NaN, completeSequenceId=9, dataLocality=1.0
    ip-172-31-5-161.cn-north-1.compute.internal:16020 1515384661153
        requestsPerSecond=0.0, numberOfOnlineRegions=0, usedHeapMB=76, maxHeapMB=5726, numberOfStores=0, numberOfStorefiles=0, storefileUncompressedSizeMB=0, storefileSizeMB=0, memstoreSizeMB=0, storefileIndexSizeMB=0, readRequestsCount=0, writeRequestsCount=0, rootIndexSizeKB=0, totalStaticIndexSizeKB=0, totalStaticBloomSizeKB=0, totalCompactingKVs=0, currentCompactedKVs=0, compactionProgressPct=NaN, coprocessors=[]
    ip-172-31-9-176.cn-north-1.compute.internal:16020 1515384675448
        requestsPerSecond=0.0, numberOfOnlineRegions=1, usedHeapMB=72, maxHeapMB=5726, numberOfStores=1, numberOfStorefiles=1, storefileUncompressedSizeMB=0, storefileSizeMB=0, memstoreSizeMB=0, storefileIndexSizeMB=0, readRequestsCount=2182, writeRequestsCount=5, rootIndexSizeKB=0, totalStaticIndexSizeKB=0, totalStaticBloomSizeKB=0, totalCompactingKVs=14, currentCompactedKVs=14, compactionProgressPct=1.0, coprocessors=[MultiRowMutationEndpoint]
        "hbase:meta,,1"
            numberOfStores=1, numberOfStorefiles=1, storefileUncompressedSizeMB=0, lastMajorCompactionTimestamp=1515734782884, storefileSizeMB=0, memstoreSizeMB=0, storefileIndexSizeMB=0, readRequestsCount=2182, writeRequestsCount=5, rootIndexSizeKB=0, totalStaticIndexSizeKB=0, totalStaticBloomSizeKB=0, totalCompactingKVs=14, currentCompactedKVs=14, compactionProgressPct=1.0, completeSequenceId=15, dataLocality=1.0
    ip-172-31-6-35.cn-north-1.compute.internal:16020 1515384691275
        requestsPerSecond=0.0, numberOfOnlineRegions=0, usedHeapMB=74, maxHeapMB=5726, numberOfStores=0, numberOfStorefiles=0, storefileUncompressedSizeMB=0, storefileSizeMB=0, memstoreSizeMB=0, storefileIndexSizeMB=0, readRequestsCount=0, writeRequestsCount=0, rootIndexSizeKB=0, totalStaticIndexSizeKB=0, totalStaticBloomSizeKB=0, totalCompactingKVs=0, currentCompactedKVs=0, compactionProgressPct=NaN, coprocessors=[]

比如 
  "member,,1515471633826.1ce5d5d93b933e78908436da444887e0."
  readRequestsCount=10, writeRequestsCount=4 

这样就可以进一步处理结果得到热点表了

==转======
You can move a region to another region server using hbase shell move command:

hbase> move ‘ENCODED_REGIONNAME’, ‘SERVER_NAME’
Move a region. Optionally specify target regionserver else we choose one at random. NOTE: You pass the encoded region name, not the region name so this command is a little different to the others. The encoded region name is the hash suffix on region names: e.g. if the region name were TestTable,0094429456,1289497600452.527db22f95c8a9e0116f0cc13c680396. then the encoded region name portion is 527db22f95c8a9e0116f0cc13c680396 A server name is its host, port plus startcode. For example: host187.example.com,60020,1289493121758
More shell commands here


How to list the regions in an HBase table through the shell? Ask





0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有