当前位置: 首页 > article >正文

Zabbix6.0升级为6.4

为了体验一些新的功能,比如 Webhook 和问题抑制等,升级个小版本。

一、环境信息

1. 版本要求

一定要事先查看官方文档,确认组件要求的版本,否则版本过高或者过低都会出现问题。

数据库版本要求

2. 升级前后信息

环境升级前升级后
操作系统CentOS 7.3CentOS 7.3
MySQL8.0.288.0.40
PHP7.4.307.4.30
Zabbix-Server-MySQL6.0.86.4
Zabbix-Web-MySQL6.0.86.4

二、升级MySQL

1. 停止数据库

mysql> set global innodb_fast_shutdown=0;

# systemctl stop mysqld

2. 安装启动8.0.40

在MySQL 8.0及之后版本中,不再需要启动后执行 mysql_upgrade 命令,会自动检测后自动升级版本。

# wget https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.40-1.el7.x86_64.rpm-bundle.tar
# tar xf mysql-8.0.40-1.el7.x86_64.rpm-bundle.tar
# yum localinstall mysql-community-* 

# systemctl start mysqld
# 查看日志 确认升级成功
# [root@zbx_db_test mysql80]# tailf /data/mysql/error.log 
2024-12-18T09:12:21.214297Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.40) starting as process 8878
2024-12-18T09:12:21.225868Z 0 [Warning] [MY-012364] [InnoDB] innodb_open_files should not be greater than the open_files_limit. 
2024-12-18T09:12:21.225931Z 0 [Warning] [MY-013907] [InnoDB] Deprecated configuration parameters innodb_log_file_size and/or innodb_log_files_in_group have been used to compute innodb_redo_log_capacity=268435456. Please use innodb_redo_log_capacity instead.
2024-12-18T09:12:21.227965Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2024-12-18T09:12:21.728676Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2024-12-18T09:12:23.042597Z 4 [System] [MY-013381] [Server] Server upgrade from '80028' to '80040' started.
2024-12-18T09:12:26.270068Z 4 [System] [MY-013381] [Server] Server upgrade from '80028' to '80040' completed.
2024-12-18T09:12:26.342403Z 0 [Warning] [MY-011302] [Server] Plugin mysqlx reported: 'Failed at SSL configuration: "SSL context is not usable without certificate and private key"'
2024-12-18T09:12:26.342534Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /var/run/mysqld/mysqlx.sock
2024-12-18T09:12:26.342595Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.40'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MySQL Community Server - GPL.

3. 不停机数据备份

在生产环境中,要进行数据备份。在 MySQL 8.0 中,不能直接用 xtrbackup 2.4 之前的版本备份,只能用 percona-xtrabackup-80.x 版本备份。

  • 数据备份
# xtrabackup  --defaults-file=/etc/my.cnf --user=root --password=xiM37mwXotfO# --backup --parallel=8  --target-dir=/data/backup1218
  • 数据还原
# xtrabackup --prepare --use-memory=4G --target-dir=/data/backup1218
# xtrabackup  --defaults-file=/etc/my.cnf --copy-back --target-dir=/data/backup1218

三、升级Zabbix-Sever

因为操作系统是 CentOS 7,已经不支持 RPM 包安装了,所以采用的是源码安装。

1. 升级安装包

# wget https://cdn.zabbix.com/zabbix/sources/stable/6.4/zabbix-6.4.20.tar.gz
# tar xf zabbix-6.4.20.tar.gz && cd zabbix-6.4.20
# ./configure --prefix=/usr/local/zabbix-server-6.4 --enable-server --enable-agent --with-mysql --with-net-snmp --with-libcurl --with-libxml2 --with-openipmi

# make install

3. 数据库设置参数

mysql> set global log_bin_trust_function_creators=1;  (在升级过程中需要开启这个参数)

如果不设置上面参数,使用新版本启动升级过程会报错失败,报错如下:

[root@zabbix_64 zabbix-server-6.4]# tailf /tmp/zabbix_server.log
 29320:20241218:171619.136 completed 11% of database upgrade
 29320:20241218:171619.171 completed 12% of database upgrade
 29320:20241218:171619.208 completed 13% of database upgrade
 29320:20241218:171619.276 completed 14% of database upgrade
 29320:20241218:171619.299 completed 15% of database upgrade
 29320:20241218:171619.303 [Z3005] query failed: [1419] You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable) [create trigger hosts_insert after insert on hosts
for each row
insert into changelog (object,objectid,operation,clock)
values (1,new.hostid,1,unix_timestamp())]
 29320:20241218:171619.304 database upgrade failed on patch 06010049, exiting in 10 seconds
 29320:20241218:171629.304 Zabbix Server stopped. Zabbix 6.4.20 (revision 114e4f42c15).
....

3. 验证升级

  • 服务启动
# 更新启动配置文件
# cat /lib/systemd/system/zabbix-server.service
[Unit]
Description=Zabbix Server
After=syslog.target
After=network.target
After=mysql.service
After=mysqld.service
After=mariadb.service
After=postgresql.service
After=pgbouncer.service
After=postgresql-9.4.service
After=postgresql-9.5.service
After=postgresql-9.6.service
After=postgresql-10.service
After=postgresql-11.service
After=postgresql-12.service

[Service]
Environment="CONFFILE=/etc/zabbix/zabbix_server.conf"
EnvironmentFile=-/etc/sysconfig/zabbix-server
Type=forking
Restart=on-failure
PIDFile=/run/zabbix/zabbix_server.pid
KillMode=control-group
ExecStart=/usr/local/zabbix-server-6.4/sbin/zabbix_server -c $CONFFILE
ExecStop=/bin/kill -SIGTERM $MAINPID
RestartSec=10s
TimeoutSec=0

[Install]
WantedBy=multi-user.target

# systemctl daemon-reload
# systemctl start zabbix-server
  • 查看日志,确认升级成功
[root@zabbix_64 zabbix-server-6.4]# tailf /tmp/zabbix_server.log

四、升级 Zabbix前端

6.4 版本,前端文件都存放在 UI 目录中。

# mv /usr/share/zabbix /usr/share/zabbix_6.0
# mv /usr/src/zabbix-server-6.4/ui /usr/share/zabbix  # 从解压目录中获取
  • 前端界面配置

不开启数据库连接加密
在这里插入图片描述



Reference:

https://www.zabbix.com/cn/whats_new_6_4
https://www.zabbix.com/cn/download_sources#64
https://www.zabbix.com/documentation/6.4/zh/manual/installation/requirements
https://www.zabbix.com/documentation/6.4/en/manual/installation/upgrade_notes_640


http://www.kler.cn/a/449795.html

相关文章:

  • WebDavClient 安装和配置指南
  • 解决 Docker 中 DataLoader 多进程错误:共享内存不足
  • react中使用ResizeObserver来观察元素的size变化
  • 被裁20240927 --- 嵌入式硬件开发 前篇
  • 0009.基于springboot+layui的ERP企业进销存管理系统
  • kotlin中泛型中in和out的区别
  • 使用Vue创建前后端分离项目的过程(前端部分)
  • OpenCV(python)从入门到精通——文件操作
  • CSS系列(32)-- Mask详解
  • 玩安卓-鸿蒙版 二 首页横幅、搜索、跳转链接功能
  • STM32的内存分区
  • 【python】数据结构之栈与队列
  • 51单片机仿真摇号抽奖机源程序 12864液晶显示
  • Flink集群批作业实践:七析BI批作业执行
  • 【源码阅读系列】(六) Android 中的进程和线程
  • kubevirt网络
  • Jmeter测试脚本编写技巧
  • 从零开始学前端之HTML(三)
  • 咸虾米壁纸微信小程序下载图片到相册saveImageToPhotosAlbum功能修改
  • PLSQL 客户端连接 Oracle 数据库配置
  • 算法day_3数组中的单一元素和二进制位颠倒
  • autMan奥特曼机器人-相关命令
  • 【漏洞复现】F5 BIG-IP Next Central Manager SQL注入漏洞(CVE-2024-26026)
  • (10)YOLOv8算法基本原理
  • EasyPlayer.js播放器在React项目中应如何使用?
  • Jenkins Api Token 访问问题