zabbix / zabbix-docker

Official Zabbix Dockerfiles
https://www.zabbix.com
GNU Affero General Public License v3.0
2.38k stars 1.37k forks source link

What is the best way to partition MySQL using Docker? #851

Closed RafaelHGBotelho closed 3 years ago

RafaelHGBotelho commented 3 years ago

What is the best way to partition MySQL using Docker?

My MySQL is about 100GB, and when I go to partition according to the manual, it seems to read all connections before uploading docker compose again, it takes hours to upload and in the end it crashes on Zabbix Server and Zabbix Proxies.

https://blog.zabbix.com/partitioning-a-zabbix-mysql-database-with-perl-or-stored-procedures/13531/

RafaelHGBotelho commented 3 years ago

To work on MySQL 8.0.25 it was necessary to comment a few lines of the Perl script and create a new image with Dockerfile.

FROM mysql:8.0 COPY ./zbx-mysql-part.pl /opt RUN chmod +x /opt/zbx-mysql-part.pl COPY ./zbx-mysql-cron /etc/cron.daily RUN apt update RUN apt install libdatetime-perl liblogger-syslog-perl libdbi-perl libdbd-mysql-perl -y

https://github.com/OpensourceICTSolutions/zabbix-mysql-partitioning-perl/blob/main/mysql_zbx_part.pl

unless ( check_have_partition() ) {...

unless (defined($part_tables->{$key})) {...

sub check_have_partition {...

RafaelHGBotelho commented 3 years ago

Definitive solution is in this repository: https://github.com/OpensourceICTSolutions/zabbix-mysql-partitioning-perl/issues/1