系统环境:rocky linux 9.4 (yum update 升级到最新版本)
数据库: mariadb 10.5.22
第一步:关闭防火墙和selinux
使用脚本关闭
systemctl stop firewalld && systemctl disable firewalld
第二步:安装 Zabbix 源
rpm -Uvh https://repo.zabbix.com/zabbix/7.0/rocky/9/x86_64/zabbix-release-7.0-3.el9.noarch.rpm dnf clean all
第三步:安装Zabbix server,Web前端,agent
dnf install zabbix-server-mysql zabbix-web-mysql zabbix-apache-conf zabbix-sql-scripts zabbix-selinux-policy zabbix-agent
第四步:安装数据库mariadb
sudo dnf install mariadb-server 安装服务
sudo systemctl start mariadb 启动服务
sudo systemctl status mariadb 然后检查服务的状态
systemctl enable mariadb 加入开机自启
数据库初始化
sudo mysql_secure_installation
一路回车
创建数据库实例及对应的用户
create database zabbix character set utf8mb4 collate utf8mb4_bin;
create user zabbix@localhost identified by '123321';
grant all privileges on zabbix.* to zabbix@localhost;
set global log_bin_trust_function_creators = 1;
quit;
导入初始架构和数据,系统将提示您输入新创建的密码
zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix
第五步:为Zabbix server配置数据库
vi /etc/zabbix/zabbix_server.conf
重启zabbix server
systemctl restart zabbix-server
第六步:启动Zabbix server和agent进程
systemctl restart zabbix-server zabbix-agent httpd php-fpm
systemctl enable zabbix-server zabbix-agent httpd php-fpm
登录成功
语言设置为中文:
dnf -y install glibc-langpack-zh.x86_64