背景不多说,直接上干货!
Zabbix-Server端:
关闭SELinux
[root@localhost ~]# setenforce 0 //临时修改,重启失效
修改配置文件:/etc/selinux/config
SELINUX=enforcing 改成 SELINUX= disabled
关闭防火墙
[root@localhost ~]# systemctl stop firewalld //关闭防火墙
[root@localhost ~]# systemctl disable firewalld //开机不启动防火墙
删除原来配置的yum源
[root@localhost ~]# rm -rf /etc/yum.repos.d/* //删除其他yum源
配置阿里云 yum源
[root@localhost ~]# vi /etc/yum.repos.d/zabbix.repo
[os]
name=os
baseurl=https://mirrors.aliyun.com/centos/7/os/x86_64/
gpgcheck=0
enabled=1
[non-supported]
name=non-supported
baseurl=https://mirrors.aliyun.com/zabbix/non-supported/rhel/7/x86_64/
gpgcheck=0
enabled=1
[zabbix]
name=zabbix 3.2
baseurl=https://mirrors.aliyun.com/zabbix/zabbix/3.2/rhel/7/x86_64/
gpgcheck=0
enabled=1
重新缓存yum源
[root@localhost ~]yum clean all
[root@localhost ~]yum repolist
安装zabbix-server
[root@localhost ~]# yum install -y zabbix-server-mysql zabbix-web-mysql
安装数据库
[root@localhost ~]# yum groupinstall -y mariadb mariadb-client
在[mysqld]下添加
character-set-server=utf8 ##设置字符集
innodb_file_per_table=1 ##让innodb每个表文件单独存放
启动mariadb数据库
[root@localhost ~]# systemctl enable mariadb
[root@localhost ~]# systemctl start mariadb
交互式界面初始化数据库
[root@localhost ~]# mysql_secure_installation
创建zabbix库