模板网站很牛,十堰秦楚网主页,网络推广培训教程,建设网站用什么为了体验一些新的功能#xff0c;比如 Webhook 和问题抑制等#xff0c;升级个小版本。 一、环境信息
1. 版本要求 一定要事先查看官方文档#xff0c;确认组件要求的版本#xff0c;否则版本过高或者过低都会出现问题。 2. 升级前后信息
环境升级前升级后操作系统CentOS… 为了体验一些新的功能比如 Webhook 和问题抑制等升级个小版本。 一、环境信息
1. 版本要求 一定要事先查看官方文档确认组件要求的版本否则版本过高或者过低都会出现问题。 2. 升级前后信息
环境升级前升级后操作系统CentOS 7.3CentOS 7.3MySQL8.0.288.0.40PHP7.4.307.4.30Zabbix-Server-MySQL6.0.86.4Zabbix-Web-MySQL6.0.86.4
二、升级MySQL
1. 停止数据库
mysql set global innodb_fast_shutdown0;# systemctl stop mysqld2. 安装启动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# 查看日志 确认升级成功
# [rootzbx_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_capacity268435456. 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 --userroot --passwordxiM37mwXotfO# --backup --parallel8 --target-dir/data/backup1218数据还原
# xtrabackup --prepare --use-memory4G --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 install3. 数据库设置参数
mysql set global log_bin_trust_function_creators1; 在升级过程中需要开启这个参数如果不设置上面参数使用新版本启动升级过程会报错失败报错如下
[rootzabbix_64 zabbix-server-6.4]# tailf /tmp/zabbix_server.log29320:20241218:171619.136 completed 11% of database upgrade29320:20241218:171619.171 completed 12% of database upgrade29320:20241218:171619.208 completed 13% of database upgrade29320:20241218:171619.276 completed 14% of database upgrade29320:20241218:171619.299 completed 15% of database upgrade29320: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 seconds29320:20241218:171629.304 Zabbix Server stopped. Zabbix 6.4.20 (revision 114e4f42c15).
....3. 验证升级
服务启动
# 更新启动配置文件
# cat /lib/systemd/system/zabbix-server.service
[Unit]
DescriptionZabbix Server
Aftersyslog.target
Afternetwork.target
Aftermysql.service
Aftermysqld.service
Aftermariadb.service
Afterpostgresql.service
Afterpgbouncer.service
Afterpostgresql-9.4.service
Afterpostgresql-9.5.service
Afterpostgresql-9.6.service
Afterpostgresql-10.service
Afterpostgresql-11.service
Afterpostgresql-12.service[Service]
EnvironmentCONFFILE/etc/zabbix/zabbix_server.conf
EnvironmentFile-/etc/sysconfig/zabbix-server
Typeforking
Restarton-failure
PIDFile/run/zabbix/zabbix_server.pid
KillModecontrol-group
ExecStart/usr/local/zabbix-server-6.4/sbin/zabbix_server -c $CONFFILE
ExecStop/bin/kill -SIGTERM $MAINPID
RestartSec10s
TimeoutSec0[Install]
WantedBymulti-user.target# systemctl daemon-reload
# systemctl start zabbix-server查看日志确认升级成功
[rootzabbix_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