大网数据广告活动
服务器运维问答

MySql server keep crashing inside docker

· 52CE 我爱测

I am running mysql inside docker with its /var/lib/mysql mounted on HOST. Eveything was working fine . Then i upgraded the docker from 1.4 to 1.5 . I rebuild the mysql image and but /var/lib/mysql stays same. Now whenever i start…

问题原文

原帖链接 · user192362127 · CC BY-SA 3.0

I am running mysql inside docker with its /var/lib/mysql mounted on HOST.

Eveything was working fine . Then i upgraded the docker from 1.4 to 1.5 .

I rebuild the mysql image and but /var/lib/mysql stays same.

Now whenever i start conatiner then the conatiner exits after 5 minutes. The log files sat this

2015-01-03 09:26:47 353 [Note] Plugin 'FEDERATED' is disabled.
2015-01-03 09:26:47 353 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-01-03 09:26:47 353 [Note] InnoDB: The InnoDB memory heap is disabled
2015-01-03 09:26:47 353 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-01-03 09:26:47 353 [Note] InnoDB: Compressed tables use zlib 1.2.8
2015-01-03 09:26:47 353 [Note] InnoDB: Using Linux native AIO
2015-01-03 09:26:47 353 [Note] InnoDB: Using CPU crc32 instructions
2015-01-03 09:26:47 353 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-01-03 09:26:47 353 [Note] InnoDB: Completed initialization of buffer pool
2015-01-03 09:26:47 353 [Note] InnoDB: Highest supported file format is Barracuda.
2015-01-03 09:26:51 353 [Note] InnoDB: 128 rollback segment(s) are active.
2015-01-03 09:26:51 353 [Note] InnoDB: Waiting for purge to start
2015-01-03 09:26:51 353 [Note] InnoDB: 5.6.19 started; log sequence number 1625977
2015-01-03 09:26:51 353 [Note] Binlog end
2015-01-03 09:26:51 353 [Note] InnoDB: FTS optimize thread exiting.
2015-01-03 09:26:51 353 [Note] InnoDB: Starting shutdown...
2015-02-13 09:08:02 1106 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
2015-02-13 09:08:02 510 [ERROR] InnoDB: Unable to lock ./ibdata1, error: 11
2015-02-13 09:08:02 510 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
2015-02-13 09:08:03 1106 [ERROR] InnoDB: Unable to lock ./ibdata1, error: 11
2015-02-13 09:08:03 1106 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
2015-02-13 09:08:03 510 [ERROR] InnoDB: Unable to lock ./ibdata1, error: 11
2015-02-13 09:08:03 510 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
2015-02-13 09:08:04 1106 [ERROR] InnoDB: Unable to lock ./ibdata1, error: 11
2015-02-13 09:08:04 1106 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.

社区高分解答

原帖链接 · Sintsov Roman · CC BY-SA 4.0

  1. Run ls -la in your mysql data directory:
-rw-r----- 1     999     999        56 апр 27 00:08 auto.cnf
-rw-r----- 1     999     999         0 мая 20 21:51 binlog.index
-rw------- 1     999     999      1679 апр 27 00:08 ca-key.pem
-rw-r--r-- 1     999     999      1107 апр 27 00:08 ca.pem
-rw-r--r-- 1     999     999      1107 апр 27 00:08 client-cert.pem
-rw------- 1     999     999      1675 апр 27 00:08 client-key.pem
drwxr-x--- 2     999     999      4096 июн  3 22:06 default
-rw-r----- 1     999     999     14730 мая 29 22:14 ib_buffer_pool
-rw-r----- 1     999     999  79691776 июн  6 08:49 ibdata1
-rw-r----- 1     999     999  50331648 июн  6 08:49 ib_logfile0
-rw-r----- 1     999     999  50331648 июн  6 08:49 ib_logfile1
-rw-r----- 1     999     999 146800640 июн  5 22:53 ibtmp1
drwxr-x--- 2     999     999      4096 апр 27 00:08 mysql
drwxr-x--- 2     999     999      4096 апр 27 00:08 performance_schema
-rw------- 1     999     999      1679 апр 27 00:08 private_key.pem
-rw-r--r-- 1     999     999       451 апр 27 00:08 public_key.pem
-rw-r--r-- 1     999     999      1107 апр 27 00:08 server-cert.pem
-rw------- 1     999     999      1679 апр 27 00:08 server-key.pem
drwxr-x--- 2     999     999     12288 апр 27 00:08 sys

In my case this is user 999

2.Try ps -ef | grep mysqld

999      22177 22138  0 мая30 ?     00:09:25 mysqld
romiras  29164  6344  0 18:12 pts/2    00:00:00 grep --color=auto mysqld
  1. Kill this process sudo kill -9 22177

  2. Run the container again

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2015-02-13)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0 / CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。