当前位置: 首页 >数据库 > zabbix 从5.0升级到5.4

zabbix 从5.0升级到5.4

Upgrade procedure

 
1 停止zabbix-server服务 Stop Zabbix processes

Stop Zabbix server to make sure that no new data is inserted into database.

# systemctl stop zabbix-server

If upgrading the proxy, stop proxy too.

# systemctl stop zabbix-proxy
It is no longer possible to start the upgraded server and have older, yet unupgraded proxies report data to a newer server. This approach, which was never recommended nor supported by Zabbix, now is officially disabled when upgrading to 5.0 (or later) from any version before 4.4, as the server will ignore data from unupgraded proxies.
2 备份历史数据库 Back up the existing Zabbix database

This is a very important step. Make sure that you have a backup of your database. It will help if the upgrade procedure fails (lack of disk space, power off, any unexpected problem).

3 备份配置文件 Back up configuration files, PHP files and Zabbix binaries

Make a backup copy of Zabbix binaries, configuration files and the PHP file directory.

Configuration files:

# mkdir /opt/zabbix-backup/# cp /etc/zabbix/zabbix_server.conf /opt/zabbix-backup/# cp /etc/httpd/conf.d/zabbix.conf  /opt/zabbix-backup/

PHP files and Zabbix binaries:

# cp -R /usr/share/zabbix/ /opt/zabbix-backup/# cp -R /usr/share/doc/zabbix-* /opt/zabbix-backup/

Backup MySQL 

  

#mysqldump -uroot -p  zabbix >20210830.sql

 

4 升级zabbix repo源 Update repository configuration package

To proceed with the upgrade your current repository package has to be updated.

# rpm -Uvh https://repo.zabbix.com/zabbix/5.4/rhel/8/x86_64/zabbix-release-5.4-1.el8.noarch.rpm
5 升级zabbix 程序 Upgrade Zabbix components

To upgrade Zabbix components you may run something like:

# yum upgrade zabbix-server-mysql zabbix-web-mysql zabbix-agent

If using PostgreSQL, substitute mysql with pgsql in the command. If upgrading the proxy, substitute server with proxy in the command. If upgrading the agent 2, substitute zabbix-agent with zabbix-agent2 in the command.

To upgrade the web frontend with Apache on RHEL 8 correctly, also run:

# yum install zabbix-apache-conf 

and make the necessary changes to this file.

To upgrade the web frontend on RHEL 7 follow distribution-specific instructions (extra steps are required to install PHP 7.2 or newer).

6 检查组件配置参数 Review component configuration parameters

See the upgrade notes for details on mandatory changes.

7 启动zabbix-server 服务 Start Zabbix processes

Start the updated Zabbix components.

# systemctl start zabbix-server# systemctl start zabbix-proxy# systemctl start zabbix-agent# systemctl start zabbix-agent2
检查状态
导入数据库 Import sql

需要先停止数据库服务

#msyql -uzabbix -p zabbix < 20210830.sql

 

zabbix5.2版本升级到zabbix5.4版本后打开页面报错,报错内容如下

问题一

Database error
The frontend does not match Zabbix database. Current database version (mandatory/optional): 5010000/5010000. Required mandatory version: 5040000. Contact your system administrator.

 

(图片来自网络)

解决办法:

进入数据库

 
mysql> show databases;mysql> use zabbix;mysql> update dbversion set mandatory=5040000;mysql> flush privileges;


重新打开web即可解决

 问题二

zabbix-server 无法启动,查看日志

tail -f /var/log/zabbix/zabbix_server.log

 
 
9332:20181010:174337.188 [Z3005] query failed: [1050] Table 'tag_filter' already exists [create table tag_filter (`tag_filterid` bigint unsigned not null,`usrgrpid` bigint unsigned not null,`groupid` bigint unsigned not null,`tag` varchar(255) default '' not null,`value` varchar(255) default '' not null,primary key (tag_filterid)
 

Fix:

Login mysql

对log中提示的所有表都drop掉,直到提示upgrade 完成,这样在浏览器上就可以正常打开和登陆zabbix

 
use zabbix;drop table tag_filter;
8 Clear web browser cookies and cache

After the upgrade you may need to clear web browser cookies and web browser cache for the Zabbix web interface to work properly.

作者:希曼博客
来源链接:https://www.cnblogs.com/lihuaichen/p/15215708.html

版权声明:
1、JavaClub(https://www.javaclub.cn)以学习交流为目的,由作者投稿、网友推荐和小编整理收藏优秀的IT技术及相关内容,包括但不限于文字、图片、音频、视频、软件、程序等,其均来自互联网,本站不享有版权,版权归原作者所有。

2、本站提供的内容仅用于个人学习、研究或欣赏,以及其他非商业性或非盈利性用途,但同时应遵守著作权法及其他相关法律的规定,不得侵犯相关权利人及本网站的合法权利。
3、本网站内容原作者如不愿意在本网站刊登内容,请及时通知本站(javaclubcn@163.com),我们将第一时间核实后及时予以删除。





本文链接:https://www.javaclub.cn/database/118108.html

标签:MySQL升级
分享给朋友:

“zabbix 从5.0升级到5.4” 的相关文章

全面解析Redis 2022年05月13日 10:22:02
mysql的查询句 2022年06月09日 23:40:52
mysql查询各分区数据量大小 2022年06月10日 23:41:45
MySql查询某一天的数据 2022年06月14日 10:43:20
mysql中查询包含反斜杠字符串 2022年06月17日 23:56:38
MYSQL优化建议 2022年06月18日 08:23:02