2019年6月14日金曜日

Zabbix history_uint.ibd 肥大化して困った。

history_uint.ibdが肥大化して52Gになった。

-rw-r-----. 1 mysql mysql 52495908864  6月 14 09:20 history_uint.ibd
-rw-r-----. 1 mysql mysql  7977566208  6月 14 09:20 trends_uint.ibd



# /etc/init.d/zabbix-server stop

1.現テーブルをコピーして別テーブルで保存(1週間分)

timestampについては以下

https://www.epochconverter.com/

mysql> CREATE TABLE history_uint_new LIKE history_uint;
mysql> INSERT INTO history_uint_new SELECT * FROM history_uint WHERE clock > 'xxxxxxxxxx';

2.コピーした別テーブルを現テーブルに移行

mysql> ALTER TABLE history_uint RENAME history_uint_old;
mysql> ALTER TABLE history_uint_new RENAME history_uint;

5.zabbix-server 起動
# /etc/init.d/zabbix-server start

0 件のコメント:

コメントを投稿

シャットダウン時の後処理 (shutdown)

# vi /etc/systemd/system/drop.service [Unit] Description= stop httpgwd DefaultDependencies=no Before=shutdown.target RefuseManualStart=true ...