[網管應用] 監控告警系統Bosun修改HBase設定限制硬碟使用量-硬碟空間不足的設定

先說明本文所遇到的問題,因為使用了docker來安裝bosun,這個系統也順利的運作,但時間一久,發現硬碟空間怎麼越來越小,不來好好的瘦身怕會爆硬碟

docker安裝bosun可以參考這篇文章 http://charleslin74.pixnet.net/blog/post/460011898-%5B%E7%B6%B2%E7%AE%A1%E6%87%89%E7%94%A8%5D-%E7%9B%A3%E6%8E%A7%E5%91%8A%E8%AD%A6%E7%B3%BB%E7%B5%B1bosun%E5%AE%89%E8%A3%9D%E9%81%8E%E7%A8%8B-%E4%BD%BF%E7%94%A8doc

所以查找了一下解決方法,以下是我的解決方法步驟

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.之後就等待設定的生效,過一段時間再來看硬碟空間,你就會發現可用空間變多了.

 

Comments |0|

Legend *) Required fields are marked
**) You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>
Category: 網管應用