分类: 系统运维
2016-09-12 10:58:54
Proxy OS:
[root@l013001 ~]# more /etc/centos-release
CentOS Linux release 7.2.1511 (Core)
=====================================================
Zabbix server' status:
Host : 10.220.128.129
# zabbix_proxy -V
zabbix_proxy (Zabbix) 3.0.4
# mysql -V
mysql Ver 15.1 Distrib 5.5.50-MariaDB, for Linux (x86_64) using readline 5.1
=====================================================
1)Install CentOS by complete installation# yum -y update
# reboot
3)enable EPEL and zabbix repo
# yum install epel-release
# rpm -ivh
4)install zabbix-proxy-mysql
# yum install zabbix-proxy
Installing:
zabbix-proxy-mysql
Installing for dependencies:
OpenIPMI-libs
OpenIPMI-modalias
fping
libtool-ltdl
net-snmp-libs
unixODBC
5)install mariadb-server and zabbix-agent
[root@l013001 yum.repos.d]# rpm -qa |grep mariadb
mariadb-libs-5.5.50-1.el7_2.x86_64
[root@l013001 yum.repos.d]# yum -y install mariadb-server
# yum install zabbix-agent
6)start and enable mariadb and reset mariadb password for root(root/zabbix123)
# systemctl start mariadb
# systemctl enable mariadb
Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.
7) # mysql_secure_installation
8) create the Zabbix Database ( zabbix_db ) and database user ( zabbix_user ) and grant all privileges to the user on the Zabbix database.
[root@l013001 /]# mysql -u root -p
Enter password:
Refer to
below command----
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 15
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.
MariaDB [(none)]> delete database zabbix_db;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'database zabbix_db' at line 1
MariaDB [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| zabbix_db |
+--------------------+
4 rows in set (0.00 sec)
MariaDB [(none)]> drop database zabbix_db;
Query OK, 0 rows affected (0.01 sec)
MariaDB [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
+--------------------+
3 rows in set (0.00 sec)
MariaDB [(none)]> create database zabbix_proxy character set utf8 collate utf8_bin;
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| zabbix_proxy |
+--------------------+
4 rows in set (0.00 sec)
MariaDB [(none)]> grant all privileges on zabbix_proxy.* to zabbix@localhost identified by 'zabbix123';
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> exit
9) # setsebool -P httpd_can_connect_zabbix=1
10)import the database schema
# cd /usr/share/doc/zabbix-proxy-mysql-3.0.4
# gunzip schema.sql.gz
# mysql -u root -p zabbix_proxy < schema.sql
Enter password:
11) # sed -i
's/^.*DBPassword=.*$/DBPassword=zabbix/' /etc/zabbix/zabbix_proxy.conf
# cp /etc/zabbix/zabbix_proxy.conf{,.bak}
12)close selinux
Take affect before next reboot and without reboot:
# setenforce 0
or
Reboot:
Vi /etc/selinux/config
# SELINUX= can take one of these three values:
SELINUX=disabled
13)start zabbix proxy
# systemctl start zabbix-proxy
# systemctl enable zabbix-proxy