centos7安装zabbix3.0.3
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了centos7安装zabbix3.0.3相关的知识,希望对你有一定的参考价值。
之前鼓捣过zabbix3.0,但是由于事就给放一边了,记录一下方便自己以后使用。
centos7安装zabbix3.0.3
检查是否关闭selinux
[[email protected] ~]# getenforce Disabled
如果没有关闭可以使用setenforce 0
来操作关闭,只不过是临时关闭而已
检查是否关闭firewalld
[[email protected] ~]# systemctl stop firewalld.service [[email protected] ~]# systemctl disable firewalld.service
MariaDB安装
repo源
[[email protected] ~]# 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/ [mariadb] name = MariaDB baseurl = http://yum.mariadb.org/10.1/centos7-amd64 gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1
安装mariadb
[[email protected] ~]# yum install MariaDB-server MariaDB-client -y
生产环境中请使用mysql_secure_installation
进行初始化操作
启动mariadb服务
[[email protected] ~]# systemctl start mariadb.service [[email protected] ~]# 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 [email protected] 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源
[[email protected] ~]# wget http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm
安装zabbix repo源
[[email protected] ~]# 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... ################################# [100%] Updating / installing... 1:zabbix-release-3.0-1.el7 ################################# [100%]
安装zabbix前提操作
安装zabbix组件
[[email protected] ~]# yum install zabbix-server-mysql zabbix-web-mysql -y
导入sql文件
[[email protected] ~]# cd /usr/share/doc/zabbix-server-mysql-3.0.3/ [[email protected] 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 root 682098 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 [[email protected] zabbix-server-mysql-3.0.3]# gunzip create.sql.gz [[email protected] zabbix-server-mysql-3.0.3]# mysql -uzabbix -p zabbix < create.sql Enter password:
替换timezone时区为Shanghai
查看timezone
[[email protected] ~]# grep "timezone" /etc/httpd/conf.d/zabbix.conf # php_value date.timezone Europe/Riga
sed替换
[[email protected] ~]# sed -i ‘[email protected]# php_value date.timezone Europe/[email protected]_value date.timezone Asia/[email protected]‘ /etc/httpd/conf.d/zabbix.conf
查看是否替换
[[email protected] ~]# grep "timezone" /etc/httpd/conf.d/zabbix.conf php_value date.timezone Asia/Shanghai
修改zabbix-server配置文件
[[email protected] ~]# 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服务
启动服务命令
[[email protected] ~]# systemctl start httpd.service [[email protected] ~]# systemctl start zabbix-server
安装zabbix
浏览器中输入http://ip/zabbix
即可
以上就是zabbix3.0.3安装过程,恩先这样
安装过程中遇见的问题
[[email protected] ~]# systemctl start zabbix-server Job for zabbix-server.service failed. See ‘systemctl status zabbix-server.service‘ and ‘journalctl -xn‘ for details.
先检查selinux是否关闭,关闭后,并安装以下两个软件。再次启动zabbix-server服务便可以启动成功。
[[email protected] ~]# yum install trousers gnutls -y
本文出自 “村里的男孩” 博客,请务必保留此出处http://noodle.blog.51cto.com/2925423/1796105
以上是关于centos7安装zabbix3.0.3的主要内容,如果未能解决你的问题,请参考以下文章