前期准备:安装mysql数据库和nginx
一、下载zabbix
rpm -Uvh https://repo.zabbix.com/zabbix/4.4/rhel/7/x86_64/zabbix-release-4.4-1.el7.noarch.rpm
yum-config-manager --enable rhel-7-server-optional-rpms
yum install epel-release numactl
yum install zabbix-server-mysql zabbix-web-mysql zabbix-nginx-conf -y
二、添加zabbix数据库
在数据库中新建数据库和zabbix账号,注意替换'password'为自己的账号
# mysql -uroot -p
password
mysql> create database zabbix_proxy character set utf8mb4 collate utf8mb4_bin;
mysql> create user zabbix@localhost identified by 'password';
mysql> grant all privileges on zabbix_proxy.* to zabbix@localhost;
mysql> set global log_bin_trust_function_creators = 1;
mysql> quit;
导入数据
cat /usr/share/zabbix-sql-scripts/mysql/proxy.sql | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix_proxy
修改配置
# mysql -uroot -p
password
mysql> set global log_bin_trust_function_creators = 0;
mysql> quit;
三、修改zabbix_server.conf配置文件
vi /etc/zabbix/zabbix_server.conf
将创建的zabbix密码放入
DBPassword=password
文件的配置项比较多,可以在vi编译器中输入 /DBPassword 快速查找
修改时区
vim /etc/httpd/conf.d/zabbix.conf
启动
systemctl start httpd.service
systemctl start php-fpm.service
systemctl start zabbix-server.service
在浏览器中输入服务器ip地址/zabbix,即可访问