1. 安装 MySQL 数据库 # rpm -i https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm2. 安装Zabbix server,Web前端,agent,mariadb-server # yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-agent mariadb-server 3. 启动mysql #systemctl start mariadb4. 创建初始数据库,创建zabbix帐号权限# mysql -uroot -p password mysql> create database zabbix character set utf8 collate utf8_bin; mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'password'; mysql> quit;导入初始架构和数据,系统将提示您输入新创建的密码。 # zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix5.为Zabbix server配置数据库编辑配置文件 /etc/zabbix/zabbix_server.conf DBPassword=password 6. 为Zabbix前端配置PHPEdit file /etc/httpd/conf.d/zabbix.conf, uncomment and set the right timezone for you.# php_value date.timezone Asia/Shanghai7.启动Zabbix server和agent进程启动Zabbix server和agent进程,并为它们设置开机自启:# systemctl restart zabbix-server zabbix-agent httpd mariadb# systemctl enable zabbix-server zabbix-agent httpd mariadb