https://www.zabbix.com/cn/download?zabbix=4.0&os_distribution=centos&os_version=7&components=server_frontend_agent&db=mysql&ws=apache
#关闭防火墙并设置开机不启动
[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
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
安装软件仓库配置包,这个包包含了 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
wget https://repo.mysql.com//mysql80-community-release-el8-1.noarch.rpm
yum -y install mysql80-community-release-el8-1.noarch.rpm
yum -y install mysql-server
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服务器安装完毕
页面更新:2024-03-19
本站资料均由网友自行发布提供,仅用于学习交流。如有版权问题,请与我联系,QQ:4156828
© CopyRight 2020-2024 All Rights Reserved. Powered By 71396.com 闽ICP备11008920号-4
闽公网安备35020302034903号