Get the App
SLTechnology News&Howtos  ›  Database  › 

Cleaning of zabbix historical data and excessive processing of libdata1 files

Shulou Source: shulou.com Published: 2022-06-01 18:39:57 10月02日 Update

A historical data cleaning

Stop related services and avoid writing data

/ etc/init.d/zabbix-server stop

/ etc/init.d/httpd stop

Emptying historical data

Mysql-uroot-p

Use zabbix

Truncate tablehistory

Optimize tablehistory

Truncate tablehistory_uint

Optimize tablehistory_uint

Truncate tabletrends

Optimize tabletrends

Truncate tabletrends_uint

Optimize tabletrends_uint

Back up the database and modify the independent tablespace

Mysqldump-R-Q-- all-databases > / opt/all.sql

/ etc/init.d/mysqld stop

Rm-fr / var/lib/mysql/*

Vim / etc/my.cnf

# set under [mysqld]

Innodb_file_per_table=1

Mysql_install_db # initialize mysql database

/ etc/init.d/mysqld start

Check whether the innodb_file_per_table parameter is in effect

Mysql-uroot-p

Mysql > showvariables like'% per_table%'

+-+ +

| | Variable_name | Value |

+-+ +

| | innodb_file_per_table | ON |

+-+ +

1 row in set (0.00 sec)

Mysql

< /opt/all.sql 三 删除数据库中zabbix原用户并重新配置 Mysql>

Dropuser zabbix@'localhost'

Mysql > grantall privileges on zabbix.* to zabbix@'localhost' identified by 'zabbix'

Mysql > flushprivileges

4. Enable zabbix and httpd services

/ etc/init.d/zabbix-server start

/ etc/init.d/httpd start

Five reference materials

Http://www.linuxidc.com/Linux/2014-12/110353.htm

Http://6034036.blog.51cto.com/6024036/1636779

Tags: Data database history historical data services parameters references backups users spaces materials references standalone configuration files processing Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux Shulou Information Docker OPPO Reno Apple