1、下载rocky-linux镜像,部署新的虚拟机
2、查看环境是否准备成功。
[root@localhost ~]# cat /etc/os-release
NAME="Rocky Linux"
VERSION="8.9 (Green Obsidian)"
[root@localhost ~]# dnf install -y https://repo.huaweicloud.com/zabbix/zabbix/5.0/rhel/8/x86_64/zabbix-release-5.0-1.el8.noarch.rpm
[root@localhost yum.repos.d]# sed -i 's#http://repo.zabbix.com#https://repo.huaweicloud.com/zabbix#' /etc/yum.repos.d/zabbix.repo
[root@localhost yum.repos.d]# dnf install -y zabbix-server-mysql
[root@localhost yum.repos.d]# dnf install -y zabbix-agent2.x86_64
[root@localhost yum.repos.d]# dnf install -y zabbix-web-mysql zabbix-apache-conf.noarch httpd
[root@localhost yum.repos.d]# dnf install -y maridb-server
[root@localhost yum.repos.d]# dnf install -y zabbix-sql-scripts.noarch
[root@localhost ~]# systemctl enable --now mariadb
Created symlink /etc/systemd/system/mysql.service → /usr/lib/systemd/system/mariadb.service.
Created symlink /etc/systemd/system/mysqld.service → /usr/lib/systemd/system/mariadb.service.
Created symlink /etc/systemd/system/multi-user.target.wants/mariadb.service → /usr/lib/systemd/system/mariadb.service.
[root@localhost ~]# getenforce
Disabled
[root@localhost ~]# systemctl is-active firewalld.service
inactive
[root@localhost ~]# mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 8
Server version: 10.3.39-MariaDB MariaDB Server
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;
Query OK, 1 row affected (0.000 sec)
MariaDB [(none)]> create user 'zabbix'@'localhost' identified by 'zabbix';
Query OK, 0 rows affected (0.000 sec)
MariaDB [(none)]> grant all privileges on zabbix.* to 'zabbix'@'localhost';
Query OK, 0 rows affected (0.000 sec)
MariaDB [(none)]> \q
Bye
[root@localhost ~]# zcat /usr/share/doc/zabbix-sql-scripts/mysql/create.sql.gz | mysql -uzabbix -pzabbix zabbix
[root@localhost ~]# vi /etc/zabbix/zabbix_server.conf
只修改密码即可
[root@localhost ~]# tail -1 /etc/php-fpm.d/zabbix.conf
php_value[date.timezone] = Asia/Shanghai
[root@localhost ~]# systemctl enable --now httpd zabbix-server.service php-fpm.service zabbix-agent2.service
出现如下页面表示配置成功