重现步骤

  • linux all in one
  • CRD - > ClusterConfiguration ->ks-installer(编辑)
  • 安装商店 openpitrix:true
  • 服务自动添加 mysql 组 与mysql 容器
  • mysql8 报错 不断重启 mysql
  • 【补充】 重新安装 devops 等都会卡在MySQL 上面,只要用到MySQL

代码报错如下

`ERROR: mysqld failed while attempting to check config

command was: “mysqld –default-authentication-plugin=mysql_native_password –expire_logs_days=3 –binlog-expire-logs-seconds=604800 –max-binlog-size=1073741824 –max_allowed_packet=104857600 –max_connections=2000 –verbose –help”

mysqld: [Warning] World-writable config file ‘/etc/mysql/my.cnf’ is ignored.

mysqld: Error on realpath() on ‘/var/lib/mysql-files’ (Error 2 - No such file or directory)

2020-12-12T01:38:26.264116Z 0 [Warning] [MY-011068] [Server] The syntax ‘expire-logs-days’ is deprecated and will be removed in a future release. Please use binlog_expire_logs_seconds instead.

2020-12-12T01:38:26.264225Z 0 [ERROR] [MY-010095] [Server] Failed to access directory for –secure-file-priv. Please make sure that directory exists and is accessible by MySQL Server. Supplied value : /var/lib/mysql-files

2020-12-12T01:38:26.265395Z 0 [ERROR] [MY-010119] [Server] Aborting`

已处理 步骤如下

  • 面板 -> 应用负载 ->工作负载
  • 找到 mysql
  • 编辑配置文件

containers:
- name: mysql
image: 'mysql:8.0.11'
args:
- '--default-authentication-plugin=mysql_native_password'
- '--expire_logs_days=3'
- '--binlog-expire-logs-seconds=604800'
- '--max-binlog-size=1073741824'
- '--max_allowed_packet=104857600'
- '--max_connections=2000'
- '--secure_file_priv=/var/lib/mysql'

上面 - '--secure_file_priv=/var/lib/mysql' 新增就好了

补充一下

  • 每次安装 都会触发这个问题
  • 例如 你安装了商店 修改过一次配置文件
  • 再次 安装 devops 还会触发这个错误
  • 希望有个 一劳永逸的方法

触发之后就会 超时一批待做清单
就是不知道为什么 会同时卡 cpu 内存 还会die掉 登录管理界面
当遇到卡顿 只能 docker 重启 然后在任务 卡顿之前先行修改 mysql 配置文件

但是有时候 安装这一个插件要重建好几次 mysql 就很绝望