Categories: zabbix

Docker Zabbix 6.4升级到zabbix 7.0

Zabbix 7.0出来了 没事做,准备升级下,之前安装参考我前一篇文章,docker安装zabbix

下载镜像

docker pull zabbix/zabbix-server-mysql:alpine-7.0-latest

docker pull zabbix/zabbix-web-nginx-mysql:alpine-7.0-latest

 

升级zabbix-server-mysql

docker stop zabbix-server-mysql

docker rm zabbix-server-mysql

然后用原来的命令把后面的标签改成7.0

docker run -d –name=zabbix-server-mysql –restart=always -e DB_SERVER_HOST=”zabbix-mysql” -e MYSQL_DATABASE=”zabbix” -e MYSQL_USER=”zabbix” -e MYSQL_PASSWORD=”zabbix” -e MYSQL_ROOT_PASSWORD=”zabbix” -e ZBX_JAVAGATEWAY=”zabbix-java-gateway” -e TZ=Asia/Shanghai –network=zabbix-network -p 10051:10051 -v /usr/local/zabbix/alertscripts:/usr/lib/zabbix/alertscripts -v /etc/timezone:/etc/timezone? -v /etc/localtime:/etc/localtime -v /usr/local/zabbix/externalscripts:/usr/lib/zabbix/externalscripts -v /usr/local/zabbix/modules:/var/lib/zabbix/modules -v /usr/local/zabbix/enc:/var/lib/zabbix/enc -v /usr/local/zabbix/ssh_keys:/var/lib/zabbix/ssh_keys -v /usr/local/zabbix/ssl/certs:/var/lib/zabbix/ssl/certs -v /usr/local/zabbix/ssl/keys:/var/lib/zabbix/ssl/keys -v /usr/local/zabbix/ssl/ssl_ca:/var/lib/zabbix/ssl/ssl_ca -v /usr/local/zabbix/snmptraps:/var/lib/zabbix/snmptraps -v /usr/local/zabbix/mibs:/var/lib/zabbix/mibs -d zabbix/zabbix-server-mysql:alpine-7.0-latest

 

升级zabbix web

docker stop zabbix-web-nginx-mysql

docker rm zabbix-web-nginx-mysql

 

docker run -dit –name zabbix-web-nginx-mysql –restart=always -e ZBX_SERVER_HOST=”zabbix-server-mysql” -e DB_SERVER_HOST=”zabbix-mysql” -e MYSQL_DATABASE=”zabbix” -e MYSQL_USER=”zabbix” -e MYSQL_PASSWORD=”zabbix” -e MYSQL_ROOT_PASSWORD=”zabbix” -e PHP_TZ=Asia/Shanghai -e TZ=Asia/Shanghai –network=zabbix-network -p 80:8080 -v /etc/timezone:/etc/timezone -v /etc/localtime:/etc/localtime -d zabbix/zabbix-web-nginx-mysql:alpine-7.0-latest

 

修复报错

尼玛,升级好怎么报错了

  • The Zabbix database version does not match current requirements. Your database version: 6050035. Required version: 7000000. Please contact your system administrator.

 

查看server有下面的报错

query failed: [1419] You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable) [create trigger proxy_insert after insert on proxy

 

for each row

insert into changelog (object,objectid,operation,clock)

values (19,new.proxyid,1,unix_timestamp())]

1:20240612:135312.233 database upgrade failed on patch 06050036, exiting in 10 seconds

 

我们登录mysql

docker exec -it zabbix-mysql /bin/bash

bash-5.1# mysql -uroot -pzabbix

mysql> SHOW VARIABLES LIKE ‘log_bin_trust_function_creators’;

mysql> SET GLOBAL log_bin_trust_function_creators = 1;

问题解决。

 

这时候我们登录zabbix 发现已经更新成了7.0.

王哥哥

Share
Published by
王哥哥