dryu999 发表于 2019-1-19 06:56:13

centos7安装zabbix3.0.3

  之前鼓捣过zabbix3.0,但是由于事就给放一边了,记录一下方便自己以后使用。

centos7安装zabbix3.0.3
检查是否关闭selinux
# getenforce
Disabled如果没有关闭可以使用setenforce 0来操作关闭,只不过是临时关闭而已
检查是否关闭firewalld
# systemctl stop firewalld.service
# systemctl disable firewalld.serviceMariaDB安装
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))
# systemctl enable mariadb.service创建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/Rigased替换
# 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即可
http://blog.运维网.com/e/u261/themes/default/images/spacer.gif
http://blog.运维网.com/e/u261/themes/default/images/spacer.gif
http://s1.运维网.com/wyfs02/M02/83/C5/wKioL1d7wN_ioX8kAACn981Ma5w602.png-wh_500x0-wm_3-wmp_4-s_387579954.png
http://s3.运维网.com/wyfs02/M02/83/C6/wKiom1d7wOCDse1-AADUcY1deo8211.png-wh_500x0-wm_3-wmp_4-s_3780692294.png
http://s3.运维网.com/wyfs02/M00/83/C5/wKioL1d7wOCCVc6pAAC6W44Nzcc151.png-wh_500x0-wm_3-wmp_4-s_1894210506.png
http://s3.运维网.com/wyfs02/M02/83/C5/wKioL1d7wODjVtGpAACxcqEkKa0206.png-wh_500x0-wm_3-wmp_4-s_795252469.png
http://s3.运维网.com/wyfs02/M02/83/C6/wKiom1d7wOGSIbC2AADXSEdx-yU719.png-wh_500x0-wm_3-wmp_4-s_120659340.png
http://s3.运维网.com/wyfs02/M00/83/C5/wKioL1d7wOHiaRwZAACnZjvcWOs505.png-wh_500x0-wm_3-wmp_4-s_3106869075.png
http://s2.运维网.com/wyfs02/M00/83/C6/wKiom1d7wOLD93ZhAACKg35L88s342.png-wh_500x0-wm_3-wmp_4-s_293956122.png
http://s4.运维网.com/wyfs02/M01/83/C5/wKioL1d7wOLB4vmCAAFA6PPd6vo917.png-wh_500x0-wm_3-wmp_4-s_4226272106.png
http://blog.运维网.com/e/u261/themes/default/images/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]
查看完整版本: centos7安装zabbix3.0.3