我有 2 个容器运行 redis 和 postgresql。重新启动 docker 服务器后,两个都失败了。但它仍然以 的状态运行Up <> minutes
,但似乎运行不正确。我在 redis 和 postgresql 上运行 docker 日志,这些是日志:
redis:
[206] 29 Mar 04:03:27.358 * RDB: 1 MB of memory used by copy-on-write
[10] 29 Mar 04:03:27.433 * Background saving terminated with success
[10] 29 Mar 04:08:28.032 * 10 changes in 300 seconds. Saving...
[10] 29 Mar 04:08:28.038 * Background saving started by pid 207
[207] 29 Mar 04:08:29.412 * DB saved on disk
[207] 29 Mar 04:08:29.413 * RDB: 1 MB of memory used by copy-on-write
[10] 29 Mar 04:08:29.449 * Background saving terminated with success
2014/03/29 04:10:48 no such file or directory
PostgreSQL的:
2014-03-28 11:05:34 UTC LOG: database system was shut down at 2014-03-28 10:57:12 UTC
2014-03-28 11:05:34 UTC LOG: database system is ready to accept connections
2014-03-28 11:05:34 UTC LOG: autovacuum launcher started
2014/03/29 04:10:48 no such file or directory
他们似乎犯了同样的错误:no such file or directory
答案1
我们发现,在容器运行时重新启动 docker 会导致 docker 无法管理的“幽灵”容器。
在升级 docker 时这一点最为明显——通常我们只需重新启动主机即可。