OpenEuler安装最新版Zabbix.20250701

1. 系统优化

systemctl stop firewalld
systemctl disable firewalld
sed -ri 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
setenforce 0

2. 安装Zabbix

加载阿里yum镜像源
vim /etc/yum.repos.d/openEuler.repo

[appstream]
name=appstream
baseurl=https://mirrors.aliyun.com/centos-stream/9-stream/AppStream/x86_64/os
gpgcheck=0
enabled=1

重新加载缓存

dnf clean all;dnf makecache

安装

rpm -Uvh https://repo.zabbix.com/zabbix/7.2/release/centos/9/noarch/zabbix-release-latest-7.2.el9.noarch.rpm
dnf install zabbix-server-mysql zabbix-web-mysql zabbix-apache-conf zabbix-sql-scripts zabbix-selinux-policy zabbix-agent -y

3. 创建初始数据库

安装mysql8最新版本,具体操作详见昨日文章。

create database zabbix character set utf8mb4 collate utf8mb4_bin;  
create user zabbix@localhost identified by 'password';  
grant all privileges on zabbix.* to zabbix@localhost;  
set global log_bin_trust_function_creators = 1;  
quit;

导入初始架构和数据,系统将提示您输入新创建zabbix用户的密码。

zcat /usr/share/zabbix/sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix

Disable log_bin_trust_function_creators option after importing database schema.

set global log_bin_trust_function_creators = 0;
quit;

4. 为Zabbix server配置数据库

vim /etc/zabbix/zabbix_server.conf

DBPassword=password

5. 启动Zabbix server和agent进程

启动Zabbix server和agent进程,并为它们设置开机自启:

systemctl restart zabbix-server zabbix-agent httpd php-fpm
systemctl enable zabbix-server zabbix-agent httpd php-fpm

6. 访问zabbix

http://host/zabbix

posted @ 2025-07-01 16:49  中国的Amadeus  阅读(113)  评论(0)    收藏  举报