一看必會系列:pinpoint docker版本 hbase占用空間過大清理

來源:本站原創 Docker 超過65 views圍觀 0條評論

 

找到容器ID
docker ps |grep hbase
9ac3608b661f        pinpointdocker/pinpoint-hbase:1.8.3       "/bin/sh -c ‘${BASE_…"   7 days ago          Up 16 hours         0.0.0.0:16010->16010/tcp, 0.0.0.0:16030->16030/tcp, 0.0.0.0:60000->60000/tcp, 0.0.0.0:60020->60020/tcp, 0.0.0.0:2180->2181/tcp   pinpoint-hbase

id  9ac3608b661f 

進入hbase 容器
docker exec -it 9ac3608b661f /bin/bash

查看哪個表占用的空間最大
[email protected]:/# du -h –max-depth=1 /home/pinpoint/hbase/data/default/

144G    /home/pinpoint/hbase/data/default/TraceV2    ——-就是這個對這個進行操作
169G    /home/pinpoint/hbase/data/default/

 

進入hbase命令模式

[email protected]:/# /opt/hbase/hbase-1.2.6/bin/hbase shell

Version 1.2.6, rUnknown, Mon May 29 02:25:32 CDT 2017

看描述
hbase(main):001:0> desc ‘TraceV2’
Table TraceV2 is ENABLED                                                                                           
TraceV2                                                                                                            
COLUMN FAMILIES DESCRIPTION                                                                                        
{NAME => ‘S’, BLOOMFILTER => ‘ROW’, VERSIONS => ‘1’, IN_MEMORY => ‘false’, KEEP_DELETED_CELLS => ‘FALSE’, DATA_BLOCK
_ENCODING => ‘PREFIX’, TTL => ‘5184000 SECONDS (60 DAYS)’, COMPRESSION => ‘NONE’, MIN_VERSIONS => ‘0’, BLOCKCACHE =>
‘true’, BLOCKSIZE => ‘65536’, REPLICATION_SCOPE => ‘0’}                                                           
1 row(s) in 0.5720 seconds

 

desc ‘TraceV2’
關閉當前表
disable ‘TraceV2’
修改表時間
alter ‘TraceV2′,{NAME=>’S’, TTL => ‘604800’}  —-這個是7天 seconds為單位
alter ‘TraceV2′,{NAME=>’S’, TTL => ‘172800’}  —改成2天,2天后自動壓縮,按需改天數

hbase(main):001:0> disable ‘TraceV2’
0 row(s) in 8.7160 seconds

hbase(main):002:0> alter ‘TraceV2′,{NAME=>’S’, TTL => ‘172800’}
Updating all regions with the new schema…
273/273 regions updated.
Done.
0 row(s) in 2.0220 seconds

開啟表
hbase(main):001:0> enable ‘TraceV2’
0 row(s) in 18.6370 seconds

對表進行壓縮
hbase(main):002:0> major_compact(‘TraceV2’)
0 row(s) in 0.9890 seconds

也可登陸頁面查詢狀態
http://IP:16010/master-status 可以看到改成2天了

default    TraceV2    273    0    0    3    0    ‘TraceV2’, {NAME => ‘S’, DATA_BLOCK_ENCODING => ‘PREFIX’, TTL => ‘172800 SECONDS (2 DAYS)’}

/dev/sdc                                       500G  313G  188G  63% /data

文章出自:CCIE那點事 http://www.qdxgqk.live/ 版權所有。本站文章除注明出處外,皆為作者原創文章,可自由引用,但請注明來源。 禁止全文轉載。
本文鏈接:http://www.qdxgqk.live/?p=4175轉載請注明轉自CCIE那點事
如果喜歡:點此訂閱本站
  • 相關文章
  • 為您推薦
  • 各種觀點
?
?
萌宠夺宝游戏