个人技术分享小站

  • 首页
  • 云计算
    • 虚拟化
  • Docker
  • K8s
  • 必修技能
    • Linux
    • Python
    • IP
  • 工具
    • 英语
    • 办公软件
    • wireshark使用手册
云计算、云原生、人工智能、微服务
欢迎来到我的博客分享部落
  1. 首页
  2. Docker
  3. 正文

【docker mysql自停止】 Plugin 'FEDERATED'+'InnoDB'

2021-01-30 4814点热度 1人点赞 0条评论

问题发现

docker运行了mysql后过段时间,mysql自停止或者启动该容器后正常,但是看状态就是不up。

问题分析

核查log有如下2问题:

2021-01-30 03:54:05+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.6.50-1debian9 started.
2021-01-30 03:54:05+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2021-01-30 03:54:05+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.6.50-1debian9 started.
2021-01-30 03:54:06 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2021-01-30 03:54:06 0 [Note] mysqld (mysqld 5.6.50) starting as process 1 ...
2021-01-30 03:54:06 1 [Note] Plugin 'FEDERATED' is disabled.
2021-01-30 03:54:06 1 [Note] InnoDB: Using atomics to ref count buffer pool pages
2021-01-30 03:54:06 1 [Note] InnoDB: The InnoDB memory heap is disabled
2021-01-30 03:54:06 1 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2021-01-30 03:54:06 1 [Note] InnoDB: Memory barrier is not used
2021-01-30 03:54:06 1 [Note] InnoDB: Compressed tables use zlib 1.2.11
2021-01-30 03:54:06 1 [Note] InnoDB: Using Linux native AIO
2021-01-30 03:54:06 1 [Note] InnoDB: Using CPU crc32 instructions
2021-01-30 03:54:06 1 [Note] InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
2021-01-30 03:54:06 1 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
2021-01-30 03:54:06 1 [ERROR] Plugin 'InnoDB' init function returned error.
2021-01-30 03:54:06 1 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2021-01-30 03:54:06 1 [ERROR] Unknown/unsupported storage engine: InnoDB
2021-01-30 03:54:06 1 [ERROR] Aborting

网上查了下需要配置个plugin federated进mysql配置文件解决问题1

配置默认引擎MyISAM解决问题2
https://www.landui.com/help/show-1388.html

问题解决

编辑下mysql容器内配置文件
docker cp wordpress-mysql:/etc/mysql/mysql.conf.d/mysqld.cnf ./

[mysqld]
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
datadir = /var/lib/mysql

#log-error = /var/log/mysql/error.log
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

编辑好文件后 拷贝进容器

docker cp mysqld.cnf wordpress-mysql:/etc/mysql/mysql.conf.d/mysqld.cnf

[mysqld]
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
datadir = /var/lib/mysql

#log-error = /var/log/mysql/error.log
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

#20210130 add 2 error info
federated
#loose-skip-innodb
default-storage-engine = MyISAM

复位mysql容器
docker restart wordpress-mysql
查看运行日志如下:

2021-01-30 16:29:21+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.6.50-1debian9 started.
2021-01-30 16:29:21+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2021-01-30 16:29:21+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.6.50-1debian9 started.
2021-01-30 16:29:22 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2021-01-30 16:29:22 0 [Note] mysqld (mysqld 5.6.50) starting as process 1 ...
2021-01-30 16:29:22 1 [Note] InnoDB: Using atomics to ref count buffer pool pages
2021-01-30 16:29:22 1 [Note] InnoDB: The InnoDB memory heap is disabled
2021-01-30 16:29:22 1 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2021-01-30 16:29:22 1 [Note] InnoDB: Memory barrier is not used
2021-01-30 16:29:22 1 [Note] InnoDB: Compressed tables use zlib 1.2.11
2021-01-30 16:29:22 1 [Note] InnoDB: Using Linux native AIO
2021-01-30 16:29:22 1 [Note] InnoDB: Using CPU crc32 instructions
2021-01-30 16:29:22 1 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2021-01-30 16:29:22 1 [Note] InnoDB: Completed initialization of buffer pool
2021-01-30 16:29:22 1 [Note] InnoDB: Highest supported file format is Barracuda.
2021-01-30 16:29:22 1 [Note] InnoDB: The log sequence numbers 1663510 and 1663510 in ibdata files do not match the log sequence number 1663560 in the ib_logfiles!
2021-01-30 16:29:22 1 [Note] InnoDB: Database was not shutdown normally!
2021-01-30 16:29:22 1 [Note] InnoDB: Starting crash recovery.
2021-01-30 16:29:22 1 [Note] InnoDB: Reading tablespace information from the .ibd files...
2021-01-30 16:29:22 1 [Note] InnoDB: Restoring possible half-written data pages
2021-01-30 16:29:22 1 [Note] InnoDB: from the doublewrite buffer...
2021-01-30 16:29:22 1 [Note] InnoDB: 128 rollback segment(s) are active.
2021-01-30 16:29:22 1 [Note] InnoDB: Waiting for purge to start
2021-01-30 16:29:22 1 [Note] InnoDB: 5.6.50 started; log sequence number 1663560
2021-01-30 16:29:22 1 [Note] RSA private key file not found: /var/lib/mysql//private_key.pem. Some authentication plugins will not work.
2021-01-30 16:29:22 1 [Note] RSA public key file not found: /var/lib/mysql//public_key.pem. Some authentication plugins will not work.
2021-01-30 16:29:22 1 [Note] Server hostname (bind-address): '*'; port: 3306
2021-01-30 16:29:22 1 [Note] IPv6 is available.
2021-01-30 16:29:22 1 [Note] - '::' resolves to '::';
2021-01-30 16:29:22 1 [Note] Server socket created on IP: '::'.
2021-01-30 16:29:22 1 [Warning] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
2021-01-30 16:29:22 1 [Warning] 'proxies_priv' entry '@ root@fa74473e4a19' ignored in --skip-name-resolve mode.
2021-01-30 16:29:22 1 [Note] Event Scheduler: Loaded 0 events
2021-01-30 16:29:22 1 [Note] mysqld: ready for connections.
Version: '5.6.50' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server (GPL)

问题后续

近期发现主机内存mysql消耗过大,不久就自行崩溃,docker都提示超出mem,正好今天看到可以免费升级2G内存轻量云服务器,后面几天再观察下是否运行稳定。

标签: 暂无
最后更新:2022-01-15

admin

这个人很懒,什么都没留下

点赞
< 上一篇
下一篇 >

文章评论

您需要 登录 之后才可以评论
主题分类
  • Docker / 5篇
  • EPC / 3篇
  • IP / 1篇
  • K8s / 1篇
  • Linux / 7篇
  • Python / 2篇
  • Wireshark / 4篇
  • 一起说 / 3篇
  • 云计算 / 4篇
  • 工具 / 1篇
  • 数据库 / 4篇
  • 马拉松 / 1篇
最新 热点 随机
最新 热点 随机
主题分享 常用应用端口 何时使用kubernetes的deployments、pods和services? 常见运维面试问题——Linux 基础 常见云计算面试问题——Openstack基础 【Oracle不能对外服务】本地只能访问127.0.0.1 不能访问分配的ip
主题分享 【docker Error字段问题】Cannot link to a non running container txt文件转成cap文件 Python将是每个程序员的标配 号段运营商归属 腾讯和阿里的城市大脑较量

COPYRIGHT © 2022 每天e问网. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang

赣ICP备20006630号-1