先說明本文所遇到的問題,因為使用了docker來安裝bosun,這個系統也順利的運作,但時間一久,發現硬碟空間怎麼越來越小,不來好好的瘦身怕會爆硬碟
所以查找了一下解決方法,以下是我的解決方法步驟
1.進入統後先查找一下bosun docker 的container id
# docker ps -a
2.使用找到的id進入container,5ebfd916a9ad是我的id,記得改成你自己的id
# docker exec -it 5ebfd916a9ad /bin/bash
3.進入hbase的介面
# /hbase/hbase/bin/hbase shell
4.列出hbase的tables
hbase(main):001:0> list TABLE tsdb tsdb-meta tsdb-tree tsdb-uid 4 row(s) in 0.3010 seconds
5.bosun的主要記錄表是在tsdb,所以我們要對這個表進行操作,操作前先看一下表的schema
hbase(main):002:0> describe 'tsdb' Table tsdb is ENABLED tsdb COLUMN FAMILIES DESCRIPTION {NAME => 't', BLOOMFILTER => 'ROW', VERSIONS => '1', IN_MEMORY => 'false', KEEP_ DELETED_CELLS => 'FALSE', DATA_BLOCK_ENCODING => 'NONE', TTL => 'FOREVER', COMPR ESSION => 'NONE', MIN_VERSIONS => '0', BLOCKCACHE => 'true', BLOCKSIZE => '65536 ', REPLICATION_SCOPE => '0'} 1 row(s) in 0.3730 seconds
6.有看到COMPRESSION => 'NONE' 及 TTL => 'FOREVER',我們要改變這二個的值,將NONE改成GZ,FOREVER改成8035200秒
hbase(main):003:0> disable 'tsdb' 0 row(s) in 1.6170 seconds hbase(main):007:0> alter 'tsdb', NAME => 't', COMPRESSION => 'GZ', TTL => '8035200' Unknown argument ignored: t Unknown argument ignored: COMPRESSION Unknown argument ignored: TTL Updating all regions with the new schema... 3/3 regions updated. Done. 0 row(s) in 1.2930 seconds hbase(main):008:0> enable 'tsdb' 0 row(s) in 0.9560 seconds hbase(main):007:0> alter 'tsdb', NAME => 't', COMPRESSION => 'GZ', TTL => '8035200' Updating all regions with the new schema... 4/4 regions updated. Done. 0 row(s) in 1.9190 seconds hbase(main):009:0> describe 'tsdb' Table tsdb is ENABLED tsdb COLUMN FAMILIES DESCRIPTION {NAME => 't', DATA_BLOCK_ENCODING => 'NONE', BLOOMFILTER => 'ROW', REPLICATION_S COPE => '0', VERSIONS => '1', COMPRESSION => 'GZ', MIN_VERSIONS => '0', TTL => ' 8035200 SECONDS (93 DAYS)', KEEP_DELETED_CELLS => 'FALSE', BLOCKSIZE => '65536', IN_MEMORY => 'false', BLOCKCACHE => 'true'} 1 row(s) in 0.0400 seconds hbase(main):008:0> enable 'tsdb' 0 row(s) in 1.2390 seconds
7.之後就等待設定的生效,過一段時間再來看硬碟空間,你就會發現可用空間變多了.
文章標籤
全站熱搜
留言列表