环境是Ubuntu 22.04 mysql nginx系统不同升级命令不同具体命令详见官方文档1、更新APT源wget https://repo.zabbix.com/zabbix/7.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_latestubuntu22.04_all.deb2、安装zabbix源dpkg -i zabbix-release_latestubuntu22.04_all.deb3、更新源信息apt-get update4、升级Zabbix组件apt-get install --only-upgrade zabbix-server-mysql zabbix-frontend-php zabbix-agent备注(1)如果使用PostgreSQL将命令中的mysql替换为pgsql(2)升级代理时将命令中的server替换为proxy(3)如果升级Zabbix agent 2需要将命令中的zabbix-agent替换为zabbix-agent2 zabbix-agent2-plugin-*升级过程中会出现关于 Zabbix server或 proxy配置的提示Configuration file /etc/apt/sources.list.d/zabbix.list Deleted (by you or by a script) since installation. Package distributor has shipped an updated version. What would you like to do about it ? Your options are: Y or I : install the package maintainers version # Y 或 I : 安装包维护者的版本 N or O : keep your currently-installed version # N 或 O : 保留当前已安装的版本 D : show the differences between the versions # D : 显示版本之间的差异 Z : start a shell to examine the situation # Z : 启动 shell 来检查情况 The default action is to keep your current version. *** zabbix.list (Y/I/N/O/D/Z) [defaultN] ?建议选N保留配置5、启动 Zabbix 进程systemctl start zabbix-server systemctl start zabbix-proxy systemctl start zabbix-agent systemctl start zabbix-agent2一般到此处已经升级完成但是此次版本升级连带着mysql数据也升级了就会出现如下报错The Zabbix database version does not match current requirements. Your database version: 6050035. Required version: 7000000. Please contact your system administrator.尝试过修改数据库的mandatory值去匹配也是不行的6、使用tail命令查看zabbix-server日志tail -f /var/log/zabbix/zabbix_server.log发现有如下的报错信息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 proxy7、登录mysq查看参数mysql SHOW VARIABLES LIKE log_bin_trust_function_creators;log_bin_trust_function_creators 值为OFF修改参数mysql SET GLOBAL log_bin_trust_function_creators 1;再次查看参数log_bin_trust_function_creators 值为ON8、重启zabbix-serversystemctl restart zabbix-server.service9、完成升级