之前鼓捣过zabbix3.0,但是由于事就给放一边了,记录一下方便自己以后使用。
[root@zabbix-server ~]# getenforce Disabled
如果没有关闭可以使用setenforce 0
来操作关闭,只不过是临时关闭而已
[root@node1 ~]# systemctl stop firewalld.service [root@node1 ~]# systemctl disable firewalld.service
repo源
[root@zabbix-server ~]# 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
[root@zabbix-server ~]# yum install MariaDB-server MariaDB-client -y
生产环境中请使用mysql_secure_installation
进行初始化操作
启动mariadb服务
[root@zabbix-server ~]# systemctl start mariadb.service [root@zabbix-server ~]# 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)
download zabbix repo源
[root@zabbix-server ~]# wget http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm
安装zabbix repo源
[root@zabbix-server ~]# 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组件
[root@zabbix-server ~]# yum install zabbix-server-mysql zabbix-web-mysql -y
导入sql文件
[root@zabbix-server ~]# cd /usr/share/doc/zabbix-server-mysql-3.0.3/ [root@zabbix-server 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 [root@zabbix-server zabbix-server-mysql-3.0.3]# gunzip create.sql.gz [root@zabbix-server zabbix-server-mysql-3.0.3]# mysql -uzabbix -p zabbix < create.sql Enter password:
查看timezone
[root@zabbix-server ~]# grep "timezone" /etc/httpd/conf.d/zabbix.conf # php_value date.timezone Europe/Riga
sed替换
[root@zabbix-server ~]# sed -i ‘s@# php_value date.timezone Europe/Riga@php_value date.timezone Asia/Shanghai@g‘ /etc/httpd/conf.d/zabbix.conf
查看是否替换
[root@zabbix-server ~]# grep "timezone" /etc/httpd/conf.d/zabbix.conf php_value date.timezone Asia/Shanghai
[root@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
启动服务命令
[root@zabbix-server ~]# systemctl start httpd.service [root@zabbix-server ~]# systemctl start zabbix-server
浏览器中输入http://ip/zabbix
即可
以上就是zabbix3.0.3安装过程,恩先这样
[root@zabbix-server ~]# systemctl start zabbix-server Job for zabbix-server.service failed. See ‘systemctl status zabbix-server.service‘ and ‘journalctl -xn‘ for details.
先检查selinux是否关闭,关闭后,并安装以下两个软件。再次启动zabbix-server服务便可以启动成功。
[root@zabbix-server ~]# yum install trousers gnutls -y
本文出自 “村里的男孩” 博客,请务必保留此出处http://noodle.blog.51cto.com/2925423/1796105
原文地址:http://noodle.blog.51cto.com/2925423/1796105