MySql 服务器在 docker 中不断崩溃

MySql 服务器在 docker 中不断崩溃

我正在 docker 中运行 mysql,并将其/var/lib/mysql安装在 HOST 上。

一切都运行良好。然后我将docker从1.4升级到1.5。

我重建了 mysql 映像,但 /var/lib/mysql 保持不变。

现在,每当我启动 conatiner 时,conatiner 都会在 5 分钟后退出。日志文件位于

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.

答案1

  1. ls -la在 mysql 数据目录中运行:
-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

就我而言,这是用户999

2.尝试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. 杀死这个进程sudo kill -9 22177

  2. 再次运行容器

相关内容