pinpoint作为监控,因为收集的信息比较多,所以保留时间过久就会发生hbase被磁盘占满多情况,这里就用pinpoint举例,如何修改hbase的表,不过使用的也是pinpoint,所以就是针对pinpoint的,看下面的例子,找到hbase安装的路径,在data没有了执行,看到表TraceV2已经有一百G了,所以这里就修改TraceV2表。
# du -h –max-depth=1 /data | grep G du: cannot access ‘–max-depth=1’: No such file or directory 99G /data/hbase/data/default/TraceV2 3.7G /data/hbase/data/default/AgentStatV2 13G /data/hbase/data/default/ApplicationTraceIndex 118G /data/hbase/data/default 118G /data/hbase/data 118G /data/hbase 5.4G /data/service/hbase/logs 6.0G /data/service/hbase 6.1G /data/service 124G /data
进入hbase,先停掉表,然后修改表的保留时间,最后在启用,最后一定要执行major_compact,否则不会自动释放。
/data/service/hbase/bin # ./hbase shell 2022-06-10 17:50:40,866 WARN [main] util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable HBase Shell Use "help" to get list of supported commands. Use "exit" to quit this interactive shell. Version 1.4.4, rfe146eb48c24d56dbcd2f669bb5ff8197e6c918b, Sun Apr 22 20:42:02 PDT 2018 hbase(main):001:0> describe '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 => '1209600 SECONDS (14 DAYS)', C OMPRESSION => 'NONE', MIN_VERSIONS => '0', BLOCKCACHE => 'true', BLOCKSIZE => '65536', REPLICATION_SCOPE => '0'} 1 row(s) in 0.9290 seconds hbase(main):002:0> disable 'TraceV2' 0 row(s) in 40.0270 seconds hbase(main):003:0> alter 'TraceV2' , {NAME=>'S',TTL=>'604800'} Updating all regions with the new schema... 256/256 regions updated. Done. 0 row(s) in 2.1390 seconds hbase(main):004:0> enable 'TraceV2' 0 row(s) in 38.6950 seconds hbase(main):005:0> describe '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 => '604800 SECONDS (7 DAYS)', COM PRESSION => 'NONE', MIN_VERSIONS => '0', BLOCKCACHE => 'true', BLOCKSIZE => '65536', REPLICATION_SCOPE => '0'} 1 row(s) in 0.0690 seconds hbase(main):006:0> major_compact 'TraceV2' 0 row(s) in 0.9610 seconds hbase(main):007:0> exit
在去查看持盘空间,你会发现,磁盘在慢慢的变小,这时你在去查看pinpoint的时候就可以正常访问了,而且数据也正常了,hbase因为数据太大,会影响数据的写入。
您可以选择一种方式赞助本站
支付宝扫一扫赞助
微信钱包扫描赞助
赏