建议大家使用Rocky Linux 8.X
https://download.rockylinux.org/pub/rocky/8/isos/x86_64/Rocky-8.9-x86_64-minimal.iso
[root@zabbix ~]# yum install https://mirrors.huaweicloud.com/zabbix/zabbix/6.2/rhel/7/x86_64/zabbix-release-6.2-3.el8.noarch.rpm
更改使用国内镜像源:
[root@zabbix ~]# sed -i 's#https://repo.zabbix.com#https://mirrors.huaweicloud.com/zabbix#' /etc/yum.repos.d/zabbix.repo
[root@zabbix ~]# yum install -y zabbix-server-mysql
[root@zabbix ~]# yum install zabbix-agent2 -y
[root@zabbix ~]# yum install zabbix-web-mysql zabbix-nginx-conf.noarch nginx -y
[root@zabbix ~]# yum install mysql-server -y
- [root@zabbix ~]# systemctl enable --now mysqld
- mysql> create database zabbix charset utf8 collate utf8_bin;
- Query OK, 1 row affected, 2 warnings (0.02 sec)
- mysql> create user zabbix@localhost identified with mysql_native_password by 'zabbix';
- Query OK, 0 rows affected (0.01 sec)
- mysql> grant all privileges on zabbix.* to zabbix@localhost;
- Query OK, 0 rows affected (0.01 sec)
导入:
- [root@zabbix ~]# yum install zabbix-sql-scripts.noarch -y
- [root@zabbix ~]# cd /usr/share/zabbix-sql-scripts/mysql
- [root@zabbix mysql]# zcat server.sql.gz | mysql zabbix
- [root@zabbix mysql]# mysql zabbix < double.sql
- [root@zabbix mysql]# mysql zabbix < history_pk_prepare.sql
[root@zabbix ~]# vim /etc/zabbix/zabbix_server
- [root@zabbix ~]# grep ^DB /etc/zabbix/zabbix_server.conf
- DBName=zabbix
- DBUser=zabbix
- DBPassword=zabbix
- [root@zabbix ~]# systemctl enable --now nginx.service php-fpm.service zabbix-server.service zabbix-agent2.service
- [root@zabbix conf.d]# yum install zabbix-web-service -y
- [root@zabbix conf.d]# systemctl enable --now zabbix-web-service.service
切换php版本:
[root@zabbix ~]# dnf module switch-to php:7.4
修改zabbix.conf
- [root@zabbix ~]# vim /etc/nginx/conf.d/zabbix.conf
- server {
- listen 8080;
- server_name 172.16.90.90;
重启服务:
#systemctl restart nginx.service php-fpm.service zabbix-server.service zabbix-agent2.service
在线安装:
http://172.16.90.90:8080