1. 系统环境
1.1 编辑配置文件/etc/yum.repos.d/epel.repo
[epel]
...
excludepkgs=zabbix*
1.2 安装Zabbix存储库
[root@zabbix7 ~]# rpm -Uvh https://repo.zabbix.com/zabbix/7.0/alma/9/x86_64/zabbix-release-latest.el9.noarch.rpm
Retrieving https://repo.zabbix.com/zabbix/7.0/alma/9/x86_64/zabbix-release-latest.el9.noarch.rpm
warning: /var/tmp/rpm-tmp.Uzwl5q: Header V4 RSA/SHA512 Signature, key ID b5333005: NOKEY
Verifying... ################################# [100%]
Preparing... ################################# [100%]
Updating / installing...
1:zabbix-release-7.0-5.el9 ################################# [100%]
[root@zabbix7 ~]# dnf clean all
21 files removed
1.3 安装Zabbix server,Web前端,agent
[root@zabbix7 ~]# dnf install zabbix-server-mysql zabbix-web-mysql zabbix-nginx-conf zabbix-sql-scripts zabbix-selinux-policy zabbix-agent
2. MySQL/MariaDB 数据库
2.1安装和配置 MySQL/MariaDB 数据库
[root@zabbix7 ~]# sudo dnf install mariadb-server
[root@zabbix7 ~]# sudo systemctl enable --now mariadb
2.2 创建初始数据库
在数据库主机上运行以下代码
[root@zabbix7 ~]# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 10.5.22-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 utf8mb4 collate utf8mb4_bin;
Query OK, 1 row affected (0.001 sec)
MariaDB [(none)]> create user zabbix@localhost identified by 'password';
Query OK, 0 rows affected (0.031 sec)
MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@localhost;
Query OK, 0 rows affected (0.024 sec)
MariaDB [(none)]> set global log_bin