Hello!
We have a fairly large environment and after hitting the wall with some issues with history and trends I decided to go the MySQL partition route using https://zabbix.org/wiki/Docs/howto/mysql_partition as a guide.
Partitioning is working just fine but I am noticing the clean up aspect of partition_maintenance isn't cleaning up older tables.
Here is how I created my tables:
DELIMITER $$
CREATE PROCEDURE `partition_maintenance_all`(SCHEMA_NAME VARCHAR(32))
BEGIN
CALL partition_maintenance(SCHEMA_NAME, 'history', 28, 1, 336);
CALL partition_maintenance(SCHEMA_NAME, 'history_log', 28, 1, 336);
CALL partition_maintenance(SCHEMA_NAME, 'history_str', 28, 1, 336);
CALL partition_maintenance(SCHEMA_NAME, 'history_text', 28, 1, 336);
CALL partition_maintenance(SCHEMA_NAME, 'history_uint', 28, 1, 336);
CALL partition_maintenance(SCHEMA_NAME, 'trends', 730, 24, 14);
CALL partition_maintenance(SCHEMA_NAME, 'trends_uint', 730, 24, 14);
END$$
DELIMITER ;
Since we have a large amount of data I opted for hourly history* tables and trends are fine daily.
I do run the following command in RHEL under cron.daily and the new tables are being created but the older ones are not dropping.
/bin/mysql -h localhost -u zabbix -pPASSWD zabbix -e "CALL partition_maintenance_all('zabbix');"
Any thoughts on where to begin to troubleshoot? I am no mysql guru but can help with commands.
We have a fairly large environment and after hitting the wall with some issues with history and trends I decided to go the MySQL partition route using https://zabbix.org/wiki/Docs/howto/mysql_partition as a guide.
Partitioning is working just fine but I am noticing the clean up aspect of partition_maintenance isn't cleaning up older tables.
Here is how I created my tables:
DELIMITER $$
CREATE PROCEDURE `partition_maintenance_all`(SCHEMA_NAME VARCHAR(32))
BEGIN
CALL partition_maintenance(SCHEMA_NAME, 'history', 28, 1, 336);
CALL partition_maintenance(SCHEMA_NAME, 'history_log', 28, 1, 336);
CALL partition_maintenance(SCHEMA_NAME, 'history_str', 28, 1, 336);
CALL partition_maintenance(SCHEMA_NAME, 'history_text', 28, 1, 336);
CALL partition_maintenance(SCHEMA_NAME, 'history_uint', 28, 1, 336);
CALL partition_maintenance(SCHEMA_NAME, 'trends', 730, 24, 14);
CALL partition_maintenance(SCHEMA_NAME, 'trends_uint', 730, 24, 14);
END$$
DELIMITER ;
Since we have a large amount of data I opted for hourly history* tables and trends are fine daily.
I do run the following command in RHEL under cron.daily and the new tables are being created but the older ones are not dropping.
/bin/mysql -h localhost -u zabbix -pPASSWD zabbix -e "CALL partition_maintenance_all('zabbix');"
Any thoughts on where to begin to troubleshoot? I am no mysql guru but can help with commands.
Comment