2:安装Zabbix8.0beta1需要的要求如下。
PHP需要8.0.0-8.5x,Apache需要2.4或者更高
Mariadb需要10.11.00-12.2.x,推荐的版本是11.4
3:通过对比发现不满足的是PHP和Mariadb其他的都满足,那么升级的步骤如下先升级PHP再升级Mariadb最后升级Zabbix.现在zabbix8.0是beta1版本,不是正式的长期支持版可以再测试环境先试试有什么问题,等正式版出了再升级安装。
4:因为CentOS Stream 8已经停止更新了,使用下面的代码更新仓库才能安装软件要不然会报错。
sed -i -e "s|mirrorlist=|#mirrorlist=|g" /etc/yum.repos.d/CentOS-*
sed -i -e "s|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g" /etc/yum.repos.d/CentOS-*
5:在安装前停掉相关的服务。httpd,mariadb,zabbix-server,php-fpm
systemctl stop httpd
systemctl stop mariadb
systemctl stop zabbix-server
systemctl stop php-fpm
dnf module switch-to php:8.2
7:现在升级MariaDB,先看看都安装了哪些软件。
8:备份数据库在卸载软件,因为我这里是虚拟化的环境打了快照,所以就不备份了,直接删除MariaDB 10.5.15
dnf remove mariadb-server mariadb-client Mariadb-common Mariadb-shared
9:卸载完成后,开始安装新的11.4版本。新建一个 repo文件
vi /etc/yum.repos.d/MariaDB.repo
# MariaDB 11.4 CentOS repository list - created 2026-06-25 01:33 UTC
# https://mariadb.org/download/
[mariadb]
name = MariaDB
# rpm.mariadb.org is a dynamic mirror if your preferred mirror goes offline. See https://mariadb.org/mirrorbits/ for details.
# baseurl = https://rpm.mariadb.org/11.4/centos/$releasever/$basearch
baseurl = https://mirrors.aliyun.com/mariadb/yum/11.4/centos/$releasever/$basearch
# gpgkey = https://rpm.mariadb.org/RPM-GPG-KEY-MariaDB
gpgkey = https://mirrors.aliyun.com/mariadb/yum/RPM-GPG-KEY-MariaDB
gpgcheck = 1
sudo dnf install MariaDB-server MariaDB-client
dnf module disable mariadb
dnf module disable mysql
13:现在开始升级Zabbix到8.0.首先安装Zabbix仓库。
rpm -Uvh https://repo.zabbix.com/zabbix/8.0/release/centos/8/noarch/zabbix-release-latest-8.0.el8.noarch.rpm
dnf clean all
8:升级Zabbix server ,Web前端还有agent。碰到Y/N一律选择Y。
dnf update zabbix-server-mysql zabbix-web-mysql zabbix-apache-conf zabbix-sql-scripts zabbix-selinux-policy zabbix-agent
systemctl start httpd
systemctl start mariadb
systemctl start zabbix-server
systemctl start php-fpm
zabbix-server启动要很久查看日志显示正在同步数据,这个看数据具体的多少
cat /var/log/zabbix/zabbix_server.log
cp /etc/httpd/conf.d/zabbix.conf /etc/httpd/conf.d/zabbix.conf.bak
sed -i 's:/usr/share/zabbix:/usr/share/zabbix/ui:g' /etc/httpd/conf.d/zabbix.conf
systemctl restart httpd
14:找了很久的原因,最后发现前端的配置文件有问题,编辑的配置文件
vi /etc/httpd/conf.d/zabbix.conf
16:所有两个/ui都删除一个,下面还有很多行,不只是图片显示的内容。
systemctl enable httpd php-fpm mariadb zebbix-server