以前鼓搗過zabbix3.0,可是因爲事就給放一邊了,記錄一下方便本身之後使用。
php
[root@zabbix-server ~]# getenforce Disabled
若是沒有關閉能夠使用setenforce 0
來操做關閉,只不過是臨時關閉而已node
[root@node1 ~]# systemctl stop firewalld.service [root@node1 ~]# systemctl disable firewalld.service
repo源mysql
[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
安裝mariadblinux
[root@zabbix-server ~]# yum install MariaDB-server MariaDB-client -y
生產環境中請使用mysql_secure_installation
進行初始化操做web
啓動mariadb服務sql
[root@zabbix-server ~]# systemctl start mariadb.service [root@zabbix-server ~]# ss -ntpl|grep mysql LISTEN 0 80 :::3306 :::* users:(("mysqld",3360,17)) [root@zabbix-server ~]# systemctl enable mariadb.service
建立zabbix庫以及用戶名和密碼等等信息centos
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源app
[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組件ide
[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