1.zabbix的yum源

rpm -ivh http://mirrors.aliyun.com/zabbix/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm

2.配置源

vi  /etc/yum.repos.d/zabbix.repo

[zabbix]
name=Zabbix Official Repository - $basearch
baseurl=http://repo.zabbix.com/zabbix/3.4/rhel/7/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
[zabbix-non-supported]
name=Zabbix Official Repository non-supported - $basearch
baseurl=http://repo.zabbix.com/non-supported/rhel/7/$basearch/
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
gpgcheck=1
[zabbix]
name=Zabbix Official Repository - $basearch
baseurl=http://mirrors.aliyun.com/zabbix/zabbix/3.0/rhel/7/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX

[zabbix-non-supported]
name=Zabbix Official Repository non-supported - $basearch
baseurl=http://mirrors.aliyun.com/zabbix/non-supported/rhel/7/$basearch/
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
gpgcheck=1

3.安装数据库 zabbix-server

yum install zabbix-server-mysql zabbix-web-mysql -y

4.安装mariadb

yum -y install  mariadb-server  mariadb

5.启动mariadb

systemctl enable mariadb
systemctl start mariadb

6.初始化mariadb,并设置账号密码(root,123456)

mysql_secure_installation
mysql -uroot -p

7.授权zabbix

create database zabbix  character set utf8 collate utf8_bin;
grant all  on zabbix.*  to zabbix@'localhost'   identified  by  '123456';
flush privileges;
quit

8.导入数据库

zcat /usr/share/doc/zabbix-server-mysql-3.0.*/create.sql.gz | mysql -uzabbix -p123456  zabbix

9.进入数据库检查

MariaDB [(none)]> show databases;

zabbix-server 的安装_数据库

MariaDB [(none)]> use zabbix
MariaDB [zabbix]> show tables;

zabbix-server 的安装_yum源_02

10.修改配置文件

vi /etc/httpd/conf/httpd.conf

zabbix-server 的安装_mysql_03

vi /etc/httpd/conf.d/zabbix.conf 
#修改配置为:
php_value date.timezone Asia/Shanghai

zabbix-server 的安装_数据库_04

修改zabbix_server 的配置数据库的文件 

vi /etc/zabbix/zabbix_server.conf 
#修改为:
DBName=zabbix
DBUser=zabbix
DBPassword=123456


zabbix-server 的安装_数据库_05zabbix-server 的安装_mysql_06

zabbix-server 的安装_数据库_07

11.启动相关服务

systemctl  restart  httpd 
systemctl enable httpd

开启zabbix主机

systemctl status zabbix-server
systemctl enable zabbix-server

12.浏览器访问zabbix服务器,访问地址:​​http://192.168.112.135/zabbix​

账号默认为Admin,密码为zabbix

zabbix-server 的安装_mysql_08