1 Red Hat 企业版 Linux
Overview
This section provides the steps required for a successful upgrade from Zabbix 6.0.x to Zabbix 6.2.x using official Zabbix packages for Red Hat Enterprise Linux.
Before the upgrade make sure to read the relevant upgrade notes!
You may also want to check the requirements for 6.2.
It may be handy to run two parallel SSH sessions during the upgrade, executing the upgrade steps in one and monitoring the server/proxy logs in another. For example, run tail -f zabbix_server.log
or tail -f zabbix_proxy.log
in the second SSH session showing you the latest log file entries and possible errors in real time. This can be critical for production instances.
升级过程
1 停止 Zabbix 进程
停止 Zabbix 服务器以确保没有新数据插入到数据库。
· # systemctl stop zabbix-server
如果升级代理,也停止代理。
·#systemctl stop zabbix-proxy
不再可能启动升级后的服务器并让旧的和未升级的代理向较新的服务器报告数据。 Zabbix 从未推荐或支持的这种方法现在已被正式禁用,因为服务器将忽略来自未升级代理的数据。
2 备份已有的Zabbix数据库
这是非常重要的一步。 确保您有数据库的备份。 如果升级过程失败(磁盘空间不足、电源关闭、任何意外问题),这将有所帮助。
3 备份配置文件、PHP文件和Zabbix二进制文件
制作 Zabbix 二进制文件、配置文件和 PHP 文件目录的备份副本。
配置文件:
· # mkdir /opt/zabbix-backup/ · # cp /etc/zabbix/zabbix_server.conf /opt/zabbix-backup/ · # cp /etc/httpd/conf.d/zabbix.conf · /opt/zabbix-backup/
PHP 文件和 Zabbix 二进制文件:
· # cp -R /usr/share/zabbix/ /opt/zabbix-backup/ · # cp -R /usr/share/zabbix-* /opt/zabbix-backup/
4 Update repository configuration package
To proceed with the upgrade your current repository package has to be updated.
# rpm -Uvh https://repo.zabbix.com/zabbix/6.2/rhel/8/x86_64/zabbix-release-6.2-1.el8.noarch.rpm
5 升级Zabbix组件
要升级 Zabbix 组件,您可以运行如下命令:
· # yum upgrade zabbix-server-mysql zabbix-web-mysql zabbix-agent
如果使用 PostgreSQL,请在命令中将 mysql
替换为 pgsql
。 如果升级代理,请在命令中将 server
替换为 proxy
。 如果升级agent 2,请在命令中将 zabbix-agent
替换为 zabbix-agent2
。
要使用 Apache on RHEL 8 正确升级 Web 前端,还要运行:
· # yum install zabbix-apache-conf
6 查看组件配置参数
有关 强制更改 的详细信息,请参阅升级说明。
7 启动Zabbix进程
启动更新后的 Zabbix 组件。
· # systemctl start zabbix-server · # systemctl start zabbix-proxy · # systemctl start zabbix-agent · # systemctl start zabbix-agent2
8 清除网络浏览器 cookie 和缓存
升级后,您可能需要清除网络浏览器 cookie 和网络浏览器缓存,以便 Zabbix web界面正常工作。
Upgrade between minor versions
It is possible to upgrade between minor versions of 6.2.x (for example, from 6.2.1 to 6.2.3). Upgrading between minor versions is easy.
To execute Zabbix minor version upgrade it is required to run:
$ sudo yum upgrade 'zabbix-*'
To execute Zabbix server minor version upgrade run:
$ sudo yum upgrade 'zabbix-server-*'
To execute Zabbix agent minor version upgrade run:
$ sudo yum upgrade 'zabbix-agent-*'
or, for Zabbix agent 2:
$ sudo yum upgrade 'zabbix-agent2-*'
Note that you may also use ‘update’ instead of ‘upgrade’ in these commands. While ‘upgrade’ will delete obsolete packages, ‘update’ will preserve them.