#打开zabbix后看见下方提示
#zabbix server is not running: the information displayed may not be current
docker logs -f zabbix-server
#出现zabbix server is not running的两种原因
mysql连接数量受限制
zabbix server的缓存大小受限制
#zabbix server的缓存大小调整
ZBX_CACHESIZE=2048M
#mysql连接数量调整
max_connections=2000
mysqlx_max_connections=2000
#重新启动服务
docker-compose --profile=all restart
[root@localhost zabbix-docker-6.2]# docker exec -it zabbix-db bash
# 使用root用户连接数据库(默认密码root_pwd)
bash-4.4# mysql -u root -proot_pwd
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 208369
Server version: 8.0.33 MySQL Community Server - GPL
Copyright (c) 2000, 2023, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show master logs;
+---------------+------------+-----------+
| Log_name | File_size | Encrypted |
+---------------+------------+-----------+
| binlog.000005 | 427074502 | No |
| binlog.000006 | 498147433 | No |
| binlog.000007 | 91397 | No |
| binlog.000008 | 866978 | No |
| binlog.000009 | 1036350 | No |
| binlog.000010 | 428031 | No |
| binlog.000011 | 29980588 | No |
| binlog.000012 | 1073742190 | No |
| binlog.000013 | 361595850 | No |
+---------------+------------+-----------+
9 rows in set (0.01 sec)
# binlog过期时间(数值为0则不会自动清理)
mysql> show variables like 'expire_logs_days';
+------------------+-------+
| Variable_name | Value |
+------------------+-------+
| expire_logs_days | 0 |
+------------------+-------+
1 row in set (0.00 sec)
# 手动删除binlog.000040以前的日志文件
mysql> purge binary logs to 'binlog.000005';
Query OK, 0 rows affected (0.07 sec)
# 配置自动清理
mysql> set global expire_logs_days=7;
则只保留7天内的 binlog 文件。
或者修改 MySQL 配置文件,设置 expire_logs_days=7 然后重启服务,即可永久生效。
# 清空所有 binlog
mysql> RESET MASTER;