centos7安装zabbix3.0.3
之前鼓捣过zabbix3.0,但是由于事就给放一边了,记录一下方便自己以后使用。centos7安装zabbix3.0.3
检查是否关闭selinux
# getenforce
Disabled
如果没有关闭可以使用setenforce 0来操作关闭,只不过是临时关闭而已
检查是否关闭firewalld
# systemctl stop firewalld.service
# systemctl disable firewalld.service
MariaDB安装
repo源
# cat /etc/yum.repos.d/MariaDB.repo
# MariaDB 10.1 CentOS repository list - created 2016-05-12 09:28 UTC
# http://mariadb.org/mariadb/repositories/
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
安装mariadb
# yum install MariaDB-server MariaDB-client -y
生产环境中请使用mysql_secure_installation进行初始化操作
启动mariadb服务
# systemctl start mariadb.service
# ss -ntpl|grep mysql
LISTEN 0 80 :::3306 :::* users:(("mysqld",3360,17))
创建zabbix库以及用户名和密码等等信息
MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.00 sec)
安装zabbix repo源
download zabbix repo源
# wget http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm
安装zabbix repo源
# rpm -ivh zabbix-release-3.0-1.el7.noarch.rpm
warning: zabbix-release-3.0-1.el7.noarch.rpm: Header V4 DSA/SHA1 Signature, key ID 79ea5ed4: NOKEY
Preparing... #################################
Updating / installing...
1:zabbix-release-3.0-1.el7 #################################
安装zabbix前提操作
安装zabbix组件
# yum install zabbix-server-mysql zabbix-web-mysql -y
导入sql文件
# cd /usr/share/doc/zabbix-server-mysql-3.0.3/
# ll
total 1832
-rw-r--r-- 1 root root 98 May 18 20:59 AUTHORS
-rw-r--r-- 1 root root682098 May 18 20:59 ChangeLog
-rw-r--r-- 1 root root 17990 May 18 20:59 COPYING
-rw-r--r-- 1 root root 1158948 May 23 16:56 create.sql.gz
-rw-r--r-- 1 root root 52 May 18 20:59 NEWS
-rw-r--r-- 1 root root 188 May 18 20:59 README
# gunzip create.sql.gz
# mysql -uzabbix -pzabbix < create.sql
Enter password:
替换timezone时区为Shanghai
查看timezone
# grep "timezone" /etc/httpd/conf.d/zabbix.conf
# php_value date.timezone Europe/Riga
sed替换
# sed -i 's@# php_value date.timezone Europe/Riga@php_value date.timezone Asia/Shanghai@g' /etc/httpd/conf.d/zabbix.conf
查看是否替换
# grep "timezone" /etc/httpd/conf.d/zabbix.conf
php_value date.timezone Asia/Shanghai
修改zabbix-server配置文件
# egrep -v "^#|^$" /etc/zabbix/zabbix_server.conf
LogFile=/var/log/zabbix/zabbix_server.log
LogFileSize=0
PidFile=/var/run/zabbix/zabbix_server.pid
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
DBPort=3306
SNMPTrapperFile=/var/log/snmptrap/snmptrap.log
Timeout=4
AlertScriptsPath=/usr/lib/zabbix/alertscripts
ExternalScripts=/usr/lib/zabbix/externalscripts
LogSlowQueries=3000
启动httpd、zabbix-server服务
启动服务命令
# systemctl start httpd.service
# systemctl start zabbix-server
安装zabbix
浏览器中输入http://ip/zabbix即可
spacer.gif以上就是zabbix3.0.3安装过程,恩先这样
安装过程中遇见的问题
# systemctl start zabbix-server
Job for zabbix-server.service failed. See 'systemctl status zabbix-server.service' and 'journalctl -xn' for details.
先检查selinux是否关闭,关闭后,并安装以下两个软件。再次启动zabbix-server服务便可以启动成功。
# yum install trousers gnutls -y
回贴赚金币啦
页:
[1]