渡人自渡 发表于 2019-1-19 11:06:27

zabbix3.2.6.1升级3.4.4图文心得

  为了在升级过程中将停机时间和数据丢失降低到最小,建议先停机升级Zabbix server,然后再逐个停机升级和启动Zabbix proxy。当所有的Proxy升级完毕后,再启动Zabbix Server。在Zabbix server的停机期间,运行状态的Proxy将会持续收集和存储数据,并在Zabbix server启动运行时,将这些数据发送给Zabbix server。在Zabbix server停机期间的任何问题(problems)的通知(notifications),只会在升级完后的server启动后再生成。
  1、首先备份yum源,备份zabbix server的配置文件,备份zabbix,升级zabbix yum源

cp /etc/yum.repos.d/zabbix.repo /etc/yum.repos.d/zabbix.repo.bak    #备份yum源
cp /etc/zabbix/zabbix_server.conf ~/zabbixbak/#备份zabbix配置
cp /etc/httpd/conf.d/zabbix.conf ~/zabbixbak/   #备份apache中zabbix配置
mysqldump -uroot --single-transaction --default-character-set=utf8 -ppassword zabbix > zabbixbak2017.sql    #备份zabbix库
# rpm -Uvh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-1.el7.centos.noarch.rpm    #升级zabbix的yum 源
Preparing...                        #################################
Updating / installing...
   1:zabbix-release-3.4-2.el7         #################################
# yum makecache fast  2、停掉zabbix server,如果升级zabbix proxy,也需要停掉zabbix proxy
# systemctl stop zabbix-server
# systemctl stop zabbix-proxy  3、备份zabbix web资料夹
cp -R /data/www/zabbix ~/zabbixbak/    #备份zabbix web配置  4、升级zabbix
  首先查询安装了哪些zabbix应用
# rpm -qa | grep zabbix
zabbix-proxy-mysql-3.2.6-1.el7.x86_64
zabbix-sender-3.2.6-1.el7.x86_64
zabbix-web-mysql-3.2.6-1.el7.noarch
zabbix-web-3.2.6-1.el7.noarch
zabbix-get-3.2.6-1.el7.x86_64
zabbix-server-mysql-3.2.6-1.el7.x86_64
zabbix-release-3.4-2.el7.noarch
zabbix-agent-3.2.6-1.el7.x86_64
zabbix-java-gateway-3.2.6-1.el7.x86_64  5、根据需要,我们升级主要的服务:
yum upgrade zabbix-proxy-mysql zabbix-web-mysql zabbix-server-mysql zabbix-web zabbix-agent  6、等待升级完成

  7、拷贝zabbix web 3.44到web目录,修改zabbix web的目录属组
cp -R /usr/share/zabbix /data/www/
chown -R apache:apache /data/www/zabbix  修复趋势图中文字体,我之前使用的微软雅黑,所以直接copy备份中的字体,如果没有请copy上传windows系统中的中文字体
# cp /data/www/zabbixbak/fonts/msy* /data/www/zabbix/fonts/   修改php字体的配置
# sed -i 's/graphfont/msyh/g' /data/www/zabbix/include/defines.inc.php | grep msyhdefine('ZBX_GRAPH_FONT_NAME',         'msyh'); // font file name
define('ZBX_FONT_NAME', 'msyh');  8、重启zabbix

# systemctl start zabbix-server
# systemctl start zabbix-proxy
# systemctl start zabbix-agent  9、打开zabbix web网址http:///zabbix/setup.php
  可以通过setup检测和重新配置,检测重新配置后建议移除setup.php
http://s1.运维网.com/images/20171218/1513610292616353.png
  如果提示database问题,请查看日志
# tail -n 100 /var/log/zabbix/zabbix_server.log48397:20171215:233509.873 enabling SNMP agent checks on host "10.1.254.19": host became available
48342:20171215:234424.931 Got signal . Exiting ...
48342:20171215:234426.933 syncing history data...
48342:20171215:234426.934 syncing history data done
48342:20171215:234426.934 syncing trend data...
48342:20171215:234431.010 syncing trend data done
48342:20171215:234431.010 Zabbix Server stopped. Zabbix 3.4.4 (revision 74338).
58349:20171215:234703.850 Starting Zabbix Server. Zabbix 3.4.4 (revision 74338).
58349:20171215:234703.850 ****** Enabled features ******
58349:20171215:234703.850 SNMP monitoring:         YES
58349:20171215:234703.850 IPMI monitoring:         YES
58349:20171215:234703.850 Web monitoring:            YES
58349:20171215:234703.850 VMware monitoring:         YES
58349:20171215:234703.850 SMTP authentication:       YES
58349:20171215:234703.850 Jabber notifications:      YES
58349:20171215:234703.850 Ez Texting notifications:YES
58349:20171215:234703.850 ODBC:                      YES
58349:20171215:234703.851 SSH2 support:            YES
58349:20171215:234703.851 IPv6 support:            YES
58349:20171215:234703.851 TLS support:               YES
58349:20171215:234703.851 ******************************
58349:20171215:234703.851 using configuration file: /etc/zabbix/zabbix_server.conf
58349:20171215:234703.857 current database version (mandatory/optional): 03020000/03040005
58349:20171215:234703.857 required mandatory version: 03040000
58349:20171215:234704.240 server #0 started zabbix官网升级说明:
Zabbix server将会自动升级数据库。开始后,Zabbix server报告当前(强制和非强制的)和需要的数据库版本。如果当前强制版本低于需要的版本,Zabbix server自动执行所需要的数据库补丁。数据库升级的开始和进度信息(百分比)将会写入Zabbix server的日志文件中。当升级完成后,将会在日志文件中写入一条“database upgrade fully completed”的信息。如果任何升级补丁失败,Zabbix server将不会启动,即使数据库当前强制版本比所需版本高,Zabbix server也不会启动。只有当数据库当前的强制版本与需要的强制版本相符时,Zabbix server才会启动。
8673:20161117:104750.259 current database version (mandatory/optional): 03040000/03040000
8673:20161117:104750.259 required mandatory version: 03040000  修改数据库中的配置

# mysql -uroot -pmysqlpass            
Welcome to the MariaDB monitor.Commands end with ; or \g.
Your MariaDB connection id is 59371
Server version: 10.1.24-MariaDB MariaDB Server
Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> use zabbix;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
MariaDB > update dbversion set mandatory=03040000;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1Changed: 1Warnings: 0  可以查看系统要求的参数,如果不符合根据提示修改

http://s1.运维网.com/images/20171218/1513610466180289.png
  按照提示完成配置即可
http://s1.运维网.com/images/20171218/1513610671123825.png



页: [1]
查看完整版本: zabbix3.2.6.1升级3.4.4图文心得