1、mariadb数据库:[root@Centos ~]# vim /etc/my.cnf
skip_name_resolve = ON
innodb_file_per_table = ON
启动服务:[root@Centos ~]# systemctl restart mariadb.service
开机自启:[root@Centos ~]# systemctl enable mariadb.service
Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.
登陆mariadb:[root@Centos ~]# mysql -uroot -p
MariaDB [(none)]> CREATE DATABASE zabbix CHARSET 'utf8';
Query OK, 1 row affected (0.00 sec)
代码语言:javascript复制MariaDB [(none)]> GRANT ALL ON zabbix.* TO 'zabbixuser'@'localhost' IDENTIFIED BY '123456';
Query OK, 0 rows affected (0.00 sec)
代码语言:javascript复制MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
2、zabbix服务器:
代码语言:javascript复制# rpm -Uvh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm
# yum clean all
安装Zabbix server,Web前端,agent
代码语言:javascript复制# yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-agent
导入数据库脚本:
代码语言:javascript复制[root@Centos ~]# cp /usr/share/doc/zabbix-server-mysql-4.0.6/create.sql.gz ./
[root@Centos ~]# gzip -d create.sql.gz
[root@Centos ~]# mysql -uzabbixuser -hlocalhost -p123456 zabbix < ./create.sql
配置文件:vim /etc/zabbix/zabbix_server.conf
DBName=zabbix
DBUser=zabbixuser
DBPassword=123456
修改时间:[root@Centos zabbix]# vim /etc/httpd/conf.d/zabbix.conf
php_value date.timezone Asia/Shanghai
启动服务:systemctl start zabbix-server.service
连接到新安装的Zabbix前端: http://server_ip_or_name/zabbix