[iyunv@jymlinux ~]# yum clean all
已加载插件:fastestmirror, langpacks
正在清理软件源: base extras updates zabbix zabbix-non-supported
Cleaning up everything
Cleaning up list of fastest mirrors
[iyunv@jymlinux ~]# yum makecache
(3)rpm包下载安装
2.配置zabbix-database,以mysql为例,可使用mysql和pgsql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
MariaDB [(none)]> create database zabbix character set utf8;
MariaDB [(none)]> grant all on zabbix.* to 'zbxuser'@'localhost' identified by 'zbxpass';
MariaDB [(none)]> grant all on zabbix.* to 'zbxuser'@'192.168.%.%' identified by 'zbxpass';
MariaDB [(none)]> flush privileges;
#连接测试
[iyunv@jymlinux ~]# mysql -uzbxuser -hlocalhost -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 4
Server version: 5.5.50-MariaDB MariaDB Server
Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
[iyunv@jymlinux ~]# vim /etc/zabbix/zabbix_server.conf
### Option: DBHost
# Database host name.
# If set to localhost, socket is used for MySQL.
# If set to empty string, socket is used for PostgreSQL.
#
# Mandatory: no
# Default:
# DBHost=localhost
DBHost=192.168.3.8 #填写连接的数据库服务器,默认是本机
### Option: DBUser
# Database user. Ignored for SQLite.
#
# Mandatory: no
# Default:
# DBUser=
DBUser=zabbix
### Option: DBPassword
# Database password. Ignored for SQLite.
# Comment this line if no password is used.
#
# Mandatory: no
# Default:
# DBUser=
DBUser=zbxuser #填写数据库用户名
### Option: DBPassword
# Database password. Ignored for SQLite.
# Comment this line if no password is used.
#
# Mandatory: no
# Default:
# DBPassword=
DBPassword=zbxpass #填写数据库密码