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

---

最新文章

  1. [CSS]复选框单选框与文字对齐问题的研究与解决.
  2. Android 文件访问权限的四种模式
  3. Visual Studio 2015官方汇总包括下载和视频
  4. python安装问题
  5. 调用DirectDraw接口和调DirectDraw7接口的不同点对比
  6. jQuery.data的是jQuery的数据缓存系统
  7. Objective-C 关于静态方法与实例方法的转载
  8. MySQL技术内幕汇总
  9. maven命令注册jar包到maven仓库
  10. GDB快速入门
  11. webpack 使用环境变量
  12. golang 删除用go get 安装的package
  13. 【repost】对JAVASCRIPT匿名函数的理解(透彻版)
  14. PHP搜索 搜索 搜索
  15. Redis的五大数据类型
  16. Upgrade to or Install Cinnamon 2.4 in Ubuntu
  17. java.time 时间和简单任务
  18. 模块型css样式
  19. 使用MultipartEntity上传文件(带进度对话框)
  20. stark - 增、删、改

热门文章

  1. mybatis入门视频总结
  2. 【西北师大-2108Java】第十次作业成绩汇总
  3. 邹传伟:对人民银行DC/EP的初步分析
  4. 按位或:多项式,FWT,min-max容斥
  5. 基于V7的新版RL-USB和RL-FlashFS的NAND完整解决方案,实现更简单,用户仅需初始化FMC
  6. Vue 路由导航解析流程
  7. navicat的一些常用快捷键
  8. 如何使用SpringBoot封装自己的Starter
  9. Python Web(二)
  10. Python只读取文本中文字符