<pre>
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
</pre>
4 个回复
tuxknight
赞同来自: girlskiller
mysql会创建.lock文件,
另外,数据库文件本来只能给一个数据库实例,你为何要把同一个数据目录挂载给两个container ?
对于有状态的服务,用Docker container还是得慎重啊。
allansun - 无名小虾
赞同来自: girlskiller
如 @tuxknight 所说,不能把同一个数据(这里特指这种包含写锁的数据)挂载给两个container。
你如果想要用MySQL Read Replication,就需要将第二个MySQL开成Slave, 可以参考这里: https://github.com/tutumcloud/ ... slave
xianlubird - Rookie at IBM
赞同来自:
这样挂载根据官方文档,貌似host主机上的文件内容会先覆盖container里面的文件内容吧
girlskiller - Web后台开发者,Docker爱好者~
赞同来自:
docker logs ID 看了一下日志,如下:
<pre>
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
</pre>