官网地址 https://www.zabbix.com/cn/download?zabbix=4.0&os_distribution=centos&os_version=7&components=server_frontend_agent&db=mysql&ws=apache 关闭防火墙和SELINUX安全模式#关闭防火墙并设置开机不启动 [root@zabbix-server ~]# systemctl disable firewalld Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service. Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service. systemctl stop firewalld 关闭SElinux安全模式 sed命令关闭selinux sed -i "/SELINUX/s/enforcing/disabled/" /etc/selinux/config sed -i "/SELINUX/s/targeted/disabled/" /etc/selinux/config grep "SELINUX" /etc/selinux/config # SELINUX= can take one of these three values: SELINUX=disabled # SELINUXTYPE= can take one of three values: SELINUXTYPE=disabled [root@zabbix-server ~]# reboot 添加yum 软件仓库删除centos8 /etc/yum.repos.d/目录下的所有yum源。cd /etc/yum.repos.d/ && rm -rf *repo 安装软件仓库配置包,这个包包含了 yum(软件包管理器)的配置文件。 # curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo # yum clean all添加 Zabbix 软件仓库 安装软件仓库配置包,这个包包含了 yum(软件包管理器)的配置文件。 # rpm -ivh https://repo.zabbix.com/zabbix/5.4/rhel/8/x86_64/zabbix-release-5.4-1.el8.noarch.rpm # yum clean all 安装Zabbix server,Web前端,agent # yum install -y zabbix-server-mysql zabbix-web-mysql zabbix-agent zabbix-apache-conf zabbix-sql-scripts 安装 Zabbix proxy 并使用 MySQL 数据库: # yum install -y zabbix-proxy-mysql安装配置mysql8下载mysql官网的仓库 wget https://repo.mysql.com//mysql80-community-release-el8-1.noarch.rpm安装mysql仓库yum -y install mysql80-community-release-el8-1.noarch.rpm安装mysql服务yum -y install mysql-server启动mysql服务并设置开机启动systemctl start mysqld.service systemctl enable mysqld.service 创建初始数据库 在数据库主机上运行以下代码。 # mysql -uroot -ppasswordmysql> create database zabbix character set utf8 collate utf8_bin;mysql> create user zabbix@localhost identified by "password";mysql> grant all privileges on zabbix.* to zabbix@localhost;mysql> set global log_bin_trust_function_creators = 1;mysql> quit; 导入初始架构和数据,系统将提示您输入新创建的密码。 # zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix 为Zabbix server配置数据库 编辑配置文件 /etc/zabbix/zabbix_server.conf DBPassword=password 启动Zabbix server和agent进程 启动Zabbix server和agent进程,并为它们设置开机自启: # systemctl restart zabbix-server zabbix-agent httpd php-fpm# systemctl enable zabbix-server zabbix-agent httpd php-fpm 配置zabbix前端 到此zabbix5.4服务器安装完毕