MySQL-8.0.18 引入了破坏性变更
2024-08-29 02:02:47
MySQL-8.0.18 引入了破坏性变更
变更日志里面有这样一项
When the server is run with --initialize, there is no reason to load non-early plugins. The server now logs a warning and ignores
any --plugin-load or --plugin-load-add options given with --initialize. (Bug #)
也就是说当我们在做初始化的时,像半同步插件这样的非必要插件是不会被加载的,一旦我们在配置文件中加入了相应的配置项,整个初始化就会失败。
场景再现
配置文件(关键部分)
[mysqld]
## replication
rpl_semi_sync_master_enabled = 1
rpl_semi_sync_slave_enabled = 1
rpl_semi_sync_master_timeout = 1000
rpl_semi_sync_master_wait_point = AFTER_SYNC
rpl_semi_sync_master_wait_no_slave = ON
rpl_semi_sync_master_wait_for_slave_count = 1
master_info_repository = table
sync_master_info = 10000
skip_slave_start = OFF
slave_load_tmpdir = /tmp/
plugin_load_add = semisync_master.so
plugin_load_add = semisync_slave.so
初始化命令
/usr/local/mysql-8.0.-linux-glibc2.-x86_64/bin/mysqld --defaults-file=/etc/my-.cnf --initialize --user=mysql3307
错误日志
--17T09::53.905909+: [System] [MY-] [Server] /usr/local/mysql-8.0.-linux-glibc2.-x86_64/bin/mysqld (mysqld 8.0.) initializing of server in progress as process --17T09::56.474963+: [Warning] [MY-] [Server] Ignoring --plugin-load[_add] list as the server is running with --initialize(-insecure).
--17T09::57.620921+: [ERROR] [MY-] [Server] unknown variable 'rpl_semi_sync_master_enabled=1'.
--17T09::57.621099+: [ERROR] [MY-] [Server] The designated data directory /database/mysql/data// is unusable. You can remove all files that the server added to it.
--17T09::57.621375+: [ERROR] [MY-] [Server] Aborting
--17T09::58.676973+: [System] [MY-] [Server] /usr/local/mysql-8.0.-linux-glibc2.-x86_64/bin/mysqld: Shutdown complete (mysqld 8.0.) MySQL Community Server - GPL.
--17T09::59.113521+: [System] [MY-] [Server] /usr/local/mysql-8.0.-linux-glibc2.-x86_64/bin/mysqld (mysqld 8.0.) starting as process
mysqld: Table 'mysql.plugin' doesn't exist
--17T09::59.941092+: [ERROR] [MY-] [Server] Could not open the mysql.plugin table. Please perform the MySQL upgrade procedure.
--17T09::00.013579+: [Warning] [MY-] [Repl] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
解决方案
方案一:由变更日志中提到的内容可以知道,我们只要在初始化时把非必要插件的内容从配置文件中去掉,初始化完成之后再加回来就行了。然而就要求 dba 特别能吃苦,特别能受累。
方案二:使用 dbm-agent 这个自动化工具,它已经对 MySQL-8.0.18 做了兼容,而且整个安装、配置、调优 过程一行命令解决
# 一行命令完成安装、配置、调优
dbma-cli-single-instance --pkg=mysql-8.0.-linux-glibc2.-x86_64.tar.xz --port= --max-mem= install
验证一下
mysql> select @@version;
+-----------+
| @@version |
+-----------+
| 8.0. |
+-----------+
row in set (0.00 sec) mysql> show plugins;
+---------------------------------+----------+--------------------+--------------------+---------+
| Name | Status | Type | Library | License |
+---------------------------------+----------+--------------------+--------------------+---------+
|
| rpl_semi_sync_master | ACTIVE | REPLICATION | semisync_master.so | GPL |
| rpl_semi_sync_slave | ACTIVE | REPLICATION | semisync_slave.so | GPL |
| clone | ACTIVE | CLONE | mysql_clone.so | GPL |
+---------------------------------+----------+--------------------+--------------------+---------+
rows in set (0.00 sec)
dbm-agent
dbm-agent 是一个开源的自动化工具,可以在 github 上看到到 https://github.com/Neeky/dbm-agent
文章转载自:https://www.sqlpy.com/blogs/books/1/chapters/13/articles/109
---
最新文章
- [CSS]复选框单选框与文字对齐问题的研究与解决.
- Android 文件访问权限的四种模式
- Visual Studio 2015官方汇总包括下载和视频
- python安装问题
- 调用DirectDraw接口和调DirectDraw7接口的不同点对比
- jQuery.data的是jQuery的数据缓存系统
- Objective-C 关于静态方法与实例方法的转载
- MySQL技术内幕汇总
- maven命令注册jar包到maven仓库
- GDB快速入门
- webpack 使用环境变量
- golang 删除用go get 安装的package
- 【repost】对JAVASCRIPT匿名函数的理解(透彻版)
- PHP搜索 搜索 搜索
- Redis的五大数据类型
- Upgrade to or Install Cinnamon 2.4 in Ubuntu
- java.time 时间和简单任务
- 模块型css样式
- 使用MultipartEntity上传文件(带进度对话框)
- stark - 增、删、改