一看必会系列:pinpoint docker版本 hbase占用空间过大清理

来源:本站原创 Docker 超过29 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

查看哪个表占用的空间最大
root@9ac3608b661f:/# du -h –max-depth=1 /home/pinpoint/hbase/data/default/

144G    /home/pinpoint/hbase/data/default/TraceV2    ——-就是这个对这个进行操作
169G    /home/pinpoint/hbase/data/default/

 

进入hbase命令模式

root@9ac3608b661f:/# /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.jdccie.com/ 版权所有。本站文章除注明出处外,皆为作者原创文章,可自由引用,但请注明来源。 禁止全文转载。
本文链接:http://www.jdccie.com/?p=4175转载请注明转自CCIE那点事
如果喜欢:点此订阅本站
  • 相关文章
  • 为您推荐
  • 各种观点