zabbix2.2升级到zabbix3.0.2
1、操作系統(tǒng)環(huán)境
[root@Server?~]#?cat?/etc/issue CentOS?release?6.4?(Final) Kernel?\r?on?an?\m [root@Server?~]#?uname?-r 2.6.32-358.el6.x86_64 [root@Server?~]#?uname?-m x86_64備份備份。。
[root@Server?~]#?cp?-a?/usr/share/zabbix?/tmp/zabbix.bak備份數(shù)據(jù)庫(kù),也可以使用mysqldump命令等等。
[root@Server?~]#?cp?/var/lib/mysql?/tmp/mysql.bak備份zabbix_server.conf文件
[root@Server?~]#?cp?/etc/zabbix/zabbix_server.conf?/tmp/zabbix_server.conf.bak2、Zabbix 3.x對(duì)PHP的要求最低為5.4,而CentOS6默認(rèn)為5.3.3,完全不滿足要求,故需要利用第三方源,將PHP升級(jí)到5.4以上,注意,不支持PHP7
3、安裝php第三方源,并安裝相應(yīng)php版本
這里選擇php5.5版本安裝
[root@Server?~]#?yum?install?php55w.x86_64?php55w-cli.x86_64?php55w-common.x86_64?php55w-gd.x86_64?php55w-ldap.x86_64?php55w-mbstring.x86_64?php55w-mcrypt.x86_64?php55w-mysql.x86_64?php55w-pdo.x86_64?-y查看安裝后的php版本
[root@Server?~]#?php?-v PHP?5.5.34?(cli)?(built:?Apr??2?2016?10:11:45)? Copyright?(c)?1997-2015?The?PHP?Group Zend?Engine?v2.5.0,?Copyright?(c)?1998-2015?Zend?Technologies4、zabbix3.x版本需要curl版,curl >= 7.20 (如需支持SMTP認(rèn)證)
[root@Server?~]#?rpm?-ivh?http://mirror.city-fan.org/ftp/contrib/yum-repo/city-fan.org-release-1-13.rhel6.noarch.rpm? Retrieving?http://mirror.city-fan.org/ftp/contrib/yum-repo/city-fan.org-release-1-13.rhel6.noarch.rpm warning:?/var/tmp/rpm-tmp.Y3iyPw:?Header?V3?DSA/SHA1?Signature,?key?ID?b56a8bac:?NOKEY Preparing...????????????????###########################################?[100%]1:city-fan.org-release???###########################################?[100%] [root@Server?~]#?yum?upgrade?libcurl?-y查看安裝后的curl版本
[root@Server?~]#?curl?-V curl?7.48.0?(x86_64-redhat-linux-gnu)?libcurl/7.48.0?OpenSSL/1.0.1e?zlib/1.2.3?c-ares/1.11.0?libidn/1.18?libssh2/1.7.0 Protocols:?dict?file?ftp?ftps?gopher?http?https?imap?imaps?ldap?ldaps?pop3?pop3s?rtsp?scp?sftp?smb?smbs?smtp?smtps?telnet?tftp? Features:?AsynchDNS?IDN?IPv6?Largefile?GSS-API?Kerberos?SPNEGO?NTLM?NTLM_WB?SSL?libz?UnixSockets?Metalink卸載第三方源,卸載不卸載自己看著辦,隨意
[root@Server?~]#?rpm?-e?city-fan.org-release官方?jīng)]有提供centos6 zabbix3.0 server,我是git clone itnihao的github上。。。
5、安裝zabbix web以及mysql等
[root@Server?RPMS]#?pwd /root/zabbix3.0-rpm/RPMS [root@Server?RPMS]#?yum?install?zabbix-web-mysql-3.0.0-1.el6.noarch.rpm?zabbix-web-3.0.0-1.el6.noarch.rpm?-y
如果yum安裝過程中出現(xiàn)......Error Summary問題,把原來zabbix卸載即可
[root@Server?RPMS]#?yum?remove?zabbix22?-y [root@Server?RPMS]#?yum?install??zabbix-server-mysql-3.0.0-1.el6.x86_64.rpm?-y
6、啟動(dòng)服務(wù)
[root@Server?RPMS]#?/etc/init.d/httpd?restart Stopping?httpd:????????????????????????????????????????????[??OK??] Starting?httpd:????????????????????????????????????????????[??OK??] [root@Server?RPMS]#?/etc/init.d/mysqld?start Starting?mysqld:???????????????????????????????????????????[??OK??]啟動(dòng)zabbix-server出現(xiàn)cannot open "/var/log/zabbixsrv/zabbix_server.log": [13] Permission denied
[root@Server?web]#?/etc/init.d/zabbix-server?restart Shutting?down?Zabbix?server:???????????????????????????????[FAILED] Starting?Zabbix?server:????????????????????????????????????[??OK??][root@Server?web]#?zabbix_server?[2285]:?cannot?open?"/var/log/zabbixsrv/zabbix_server.log":?[13]?Permission?denied解決:
[root@Server?zabbixsrv]#?touch?/var/log/zabbixsrv/zabbix_server.log [root@Server?zabbixsrv]#?chown?zabbix?zabbix_server.log [root@Server?zabbixsrv]#?/etc/init.d/zabbix-server?restart Shutting?down?Zabbix?server:???????????????????????????????[FAILED] Starting?Zabbix?server:????????????????????????????????????[??OK??]出現(xiàn)pid問題
[root@Server?zabbixsrv]#?tail?-f?zabbix_server.logzabbix_server [2368]: cannot create PID file [/var/run/zabbixsrv/zabbix_server.pid]: [2] No such file or directory
創(chuàng)建相應(yīng)目錄以及相應(yīng)的權(quán)限即可,最后重啟服務(wù)
[root@Server?zabbixsrv]#?mkdir?/var/run/zabbixsrv/ [root@Server?zabbixsrv]#?chown?zabbix?/var/run/zabbixsrv/?-R [root@Server?zabbixsrv]#?/etc/init.d/zabbix-server?restart Shutting?down?Zabbix?server:???????????????????????????????[FAILED] Starting?Zabbix?server:????????????????????????????????????[??OK??]7、替換date.timezone改成Shanghai即可,操作如下
[root@Server?~]#?cd?/etc/httpd/conf.d/ [root@Server?conf.d]#?ls php.conf??README??welcome.conf??zabbix.conf [root@Server?conf.d]#?cp?zabbix.conf?zabbix.conf.bak [root@Server?conf.d]#?sed?-i?"s@#?php_value?date.timezone?Europe/Riga@php_value?date.timezone?Asia/Shanghai@g"?/etc/httpd/conf.d/zabbix.conf重啟httpd服務(wù)即可
[root@Server?conf.d]#?/etc/init.d/httpd?restart Stopping?httpd:????????????????????????????????????????????[FAILED] Starting?httpd:????????????????????????????????????????????[??OK??]8、安裝agent3.0版本
[root@Server?RPMS]#?pwd /root/zabbix3.0-rpm/RPMS [root@Server?RPMS]#?ls zabbix-agent-3.0.0-1.el6.x86_64.rpm?????????zabbix-proxy-sqlite3-3.0.0-1.el6.x86_64.rpm??zabbix-web-japanese-3.0.0-1.el6.noarch.rpm zabbix-get-3.0.0-1.el6.x86_64.rpm???????????zabbix-sender-3.0.0-1.el6.x86_64.rpm?????????zabbix-web-mysql-3.0.0-1.el6.noarch.rpm zabbix-java-gateway-3.0.0-1.el6.x86_64.rpm??zabbix-server-mysql-3.0.0-1.el6.x86_64.rpm???zabbix-web-pgsql-3.0.0-1.el6.noarch.rpm zabbix-proxy-mysql-3.0.0-1.el6.x86_64.rpm???zabbix-server-pgsql-3.0.0-1.el6.x86_64.rpm zabbix-proxy-pgsql-3.0.0-1.el6.x86_64.rpm???zabbix-web-3.0.0-1.el6.noarch.rpm安裝zabbix-agent3.0版本即可。也可以yum install *.rpm安裝所有的,根據(jù)自己的情況去安裝即可
[root@Server?RPMS]#?yum?install?zabbix-agent-3.0.0-1.el6.x86_64.rpm查看zabbix-agent安裝后的版本
[root@Server?zabbix]#?zabbix_agentd?-V zabbix_agentd?(daemon)?(Zabbix)?3.0.0 Revision?58460?15?February?2016,?compilation?time:?Feb?17?2016?09:55:34修改zabbix_agentd.conf文件連接zabbix-server服務(wù)器ip地址即可,重啟服務(wù)
[root@Server?zabbix]#?/etc/init.d/zabbix-agent?restart Shutting?down?Zabbix?agent:????????????????????????????????[FAILED] Starting?Zabbix?agent:?????????????????????????????????????[??OK??]9、登錄瀏覽器查看
收工,下班走人。。
轉(zhuǎn)載于:https://blog.51cto.com/noodle/1768354
總結(jié)
以上是生活随笔為你收集整理的zabbix2.2升级到zabbix3.0.2的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 项目如何从 SVN 迁移到 Git
- 下一篇: Codeforces Round #32