我运行了docker system prune
,但是用 Control + C 停止了执行。运行命令后,我无法运行需要Docker守护程序的命令。我试图重新启动守护程序,并得到以下信息:
-sh-4.2$ sudo systemctl restart docker.service
Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.
systemctl status
输出:
-sh-4.2$ sudo systemctl status docker.service -l
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
Active: activating (start) since Tue 2018-06-19 16:36:20 UTC; 2min 32s ago
Docs: https://docs.docker.com
Main PID: 104598 (dockerd)
Tasks: 143
Memory: 76.0M
CGroup: /system.slice/docker.service
├─ 1602 docker-containerd-shim 3229ed3997f06154218ce5b64dbf1e33b474e8ec16f30d44a9ce02da4ed98334 /var/run/docker/libcontainerd/3229ed3997f06154218ce5b64dbf1e33b474e8ec16f30d44a9ce02da4ed98334 docker-runc
├─ 3191 docker-containerd-shim c74d612a4429d7444deecb312ba09f1b2d92da9e643ac2737d53204a28a39c5c /var/run/docker/libcontainerd/c74d612a4429d7444deecb312ba09f1b2d92da9e643ac2737d53204a28a39c5c docker-runc
├─ 3251 docker-containerd-shim bb14d65f29175a460cd89308619e520f30b9b7f9320b64511c97b2bcfc3c9112 /var/run/docker/libcontainerd/bb14d65f29175a460cd89308619e520f30b9b7f9320b64511c97b2bcfc3c9112 docker-runc
├─ 3338 docker-containerd-shim 318dd31c8fdab10887139d5a63e8eb50fd5928621304191a1892436e63e41f47 /var/run/docker/libcontainerd/318dd31c8fdab10887139d5a63e8eb50fd5928621304191a1892436e63e41f47 docker-runc
├─ 3520 docker-containerd-shim 7091e79c1b1ae522368b72d688d0024851828eab46b43f089bc17fef81144f09 /var/run/docker/libcontainerd/7091e79c1b1ae522368b72d688d0024851828eab46b43f089bc17fef81144f09 docker-runc
├─ 3682 docker-containerd-shim fedddf4b5039b811197d3e1a1ad12d72c3b7fba4e160622c7aa4a014bd309876 /var/run/docker/libcontainerd/fedddf4b5039b811197d3e1a1ad12d72c3b7fba4e160622c7aa4a014bd309876 docker-runc
├─ 3868 docker-containerd-shim 56ce066f816a956d8901ff5b2cb80635407ffe050f63fb27a94a3ad455953e2d /var/run/docker/libcontainerd/56ce066f816a956d8901ff5b2cb80635407ffe050f63fb27a94a3ad455953e2d docker-runc
├─ 4289 docker-containerd-shim a13800839b06e207959aa860170cc652c22edb7191a251367f607db1b00e784d /var/run/docker/libcontainerd/a13800839b06e207959aa860170cc652c22edb7191a251367f607db1b00e784d docker-runc
├─ 4384 docker-containerd-shim 58c4b0c6f6b5ff345299172936ac241cb574ede4ed1e9d59305868defda3ef66 /var/run/docker/libcontainerd/58c4b0c6f6b5ff345299172936ac241cb574ede4ed1e9d59305868defda3ef66 docker-runc
├─ 4695 docker-containerd-shim 6bfc0e85b1d8895290753aaad86d5d43a7fbe8216434e407340686ebabf19470 /var/run/docker/libcontainerd/6bfc0e85b1d8895290753aaad86d5d43a7fbe8216434e407340686ebabf19470 docker-runc
├─ 42285 docker-containerd-shim 502c46c8373c13255f41019078237e7b7bb996474ad2e56298e507e7f54cb047 /var/run/docker/libcontainerd/502c46c8373c13255f41019078237e7b7bb996474ad2e56298e507e7f54cb047 docker-runc
├─ 56143 docker-containerd-shim 951af52630a461601dd44a990749156f3271516b20cef547b97ab0ef1677dc2d /var/run/docker/libcontainerd/951af52630a461601dd44a990749156f3271516b20cef547b97ab0ef1677dc2d docker-runc
├─104598 /usr/bin/dockerd
└─104609 docker-containerd -l unix:///var/run/docker/libcontainerd/docker-containerd.sock --metrics-interval=0 --start-timeout 2m --state-dir /var/run/docker/libcontainerd/containerd --shim docker-containerd-shim --runtime docker-runc
Jun 19 16:36:20 <hostname> systemd[1]: docker.service holdoff time over, scheduling restart.
Jun 19 16:36:20 <hostname> systemd[1]: Starting Docker Application Container Engine...
Jun 19 16:36:20 <hostname> dockerd[104598]: time="2018-06-19T16:36:20.297465266Z" level=info msg="libcontainerd: new containerd process, pid: 104609"
Jun 19 16:36:21 <hostname> dockerd[104598]: time="2018-06-19T16:36:21.301363251Z" level=warning msg="failed to rename /data/docker/tmp for background deletion: %!s(<nil>). Deleting synchronously"
Jun 19 16:36:21 <hostname> dockerd[104598]: time="2018-06-19T16:36:21.319590431Z" level=warning msg="devmapper: Usage of loopback devices is strongly discouraged for production use. Please use `--storage-opt dm.thinpooldev` or use `man docker` to refer to dm.thinpooldev section."
Jun 19 16:36:21 <hostname> dockerd[104598]: time="2018-06-19T16:36:21.351594000Z" level=warning msg="devmapper: Base device already exists and has filesystem xfs on it. User specified filesystem will be ignored."
Jun 19 16:36:21 <hostname> dockerd[104598]: time="2018-06-19T16:36:21.370257369Z" level=info msg="[graphdriver] using prior storage driver: devicemapper"
journalctl
输出:
-sh-4.2$ sudo journalctl -xe
Jun 19 16:13:15 <hostname> kernel: dev_remove: 41 callbacks suppressed
Jun 19 16:12:39 <hostname> kernel: dev_remove: 41 callbacks suppressed
Jun 19 16:12:44 <hostname> kernel: dev_remove: 41 callbacks suppressed
Jun 19 16:12:49 <hostname> kernel: dev_remove: 41 callbacks suppressed
Jun 19 16:12:54 <hostname> kernel: dev_remove: 41 callbacks suppressed
Jun 19 16:13:00 <hostname> kernel: dev_remove: 41 callbacks suppressed
Jun 19 16:13:05 <hostname> kernel: dev_remove: 41 callbacks suppressed
Jun 19 16:13:10 <hostname> kernel: dev_remove: 41 callbacks suppressed
Jun 19 16:13:15 <hostname> kernel: dev_remove: 41 callbacks suppressed
Jun 19 16:13:20 <hostname> kernel: dev_remove: 41 callbacks suppressed
Jun 19 16:13:25 <hostname> kernel: dev_remove: 41 callbacks suppressed
Jun 19 16:13:30 <hostname> kernel: dev_remove: 41 callbacks suppressed
Jun 19 16:13:36 <hostname> kernel: dev_remove: 41 callbacks suppressed
Jun 19 16:13:41 <hostname> kernel: dev_remove: 41 callbacks suppressed
Jun 19 16:13:46 <hostname> kernel: dev_remove: 41 callbacks suppressed
Jun 19 16:13:51 <hostname> kernel: dev_remove: 41 callbacks suppressed
Jun 19 16:13:56 <hostname> kernel: dev_remove: 40 callbacks suppressed
Jun 19 16:14:01 <hostname> kernel: dev_remove: 41 callbacks suppressed
Jun 19 16:14:06 <hostname> kernel: dev_remove: 41 callbacks suppressed
Jun 19 16:14:11 <hostname> kernel: dev_remove: 41 callbacks suppressed
Jun 19 16:14:17 <hostname> kernel: dev_remove: 41 callbacks suppressed
Jun 19 16:14:22 <hostname> kernel: dev_remove: 41 callbacks suppressed
Jun 19 16:14:27 <hostname> kernel: dev_remove: 41 callbacks suppressed
Jun 19 16:14:32 <hostname> kernel: dev_remove: 41 callbacks suppressed
Jun 19 16:14:37 <hostname> kernel: dev_remove: 41 callbacks suppressed
Jun 19 16:14:42 <hostname> kernel: dev_remove: 41 callbacks suppressed
Jun 19 16:14:47 <hostname> kernel: dev_remove: 41 callbacks suppressed
Jun 19 16:14:53 <hostname> kernel: dev_remove: 41 callbacks suppressed
Jun 19 16:14:58 <hostname> kernel: dev_remove: 41 callbacks suppressed
Jun 19 16:15:03 <hostname> kernel: dev_remove: 41 callbacks suppressed
Jun 19 16:15:08 <hostname> kernel: dev_remove: 41 callbacks suppressed
Jun 19 16:15:13 <hostname> kernel: dev_remove: 41 callbacks suppressed
Jun 19 16:15:18 <hostname> kernel: dev_remove: 41 callbacks suppressed
Jun 19 16:15:23 <hostname> kernel: dev_remove: 40 callbacks suppressed
Jun 19 16:15:28 <hostname> kernel: dev_remove: 41 callbacks suppressed
Jun 19 16:15:34 <hostname> kernel: dev_remove: 41 callbacks suppressed
Jun 19 16:15:39 <hostname> kernel: dev_remove: 41 callbacks suppressed
Jun 19 16:15:44 <hostname> kernel: dev_remove: 41 callbacks suppressed
Jun 19 16:15:49 <hostname> kernel: dev_remove: 41 callbacks suppressed
Jun 19 16:15:54 <hostname> kernel: dev_remove: 41 callbacks suppressed
Jun 19 16:15:59 <hostname> kernel: dev_remove: 41 callbacks suppressed
Jun 19 16:16:03 <hostname> dockerd[101416]: Error starting daemon: error while opening volume store metadata database: invalid database
Jun 19 16:16:03 <hostname> systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
Jun 19 16:16:03 <hostname> systemd[1]: Failed to start Docker Application Container Engine.
-- Subject: Unit docker.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit docker.service has failed.
--
-- The result is failed.
Jun 19 16:16:03 <hostname> systemd[1]: Unit docker.service entered failed state.
Jun 19 16:16:03 <hostname> systemd[1]: docker.service failed.
Jun 19 16:16:03 <hostname> polkitd[719]: Unregistered Authentication Agent for unix-process:101221:264162337 (system bus name :1.11957, object path /org/freedesktop/PolicyKit1/AuthenticationAgent
Jun 19 16:16:03 <hostname> systemd[1]: docker.service holdoff time over, scheduling restart.
Jun 19 16:16:03 <hostname> systemd[1]: Starting Docker Application Container Engine...
-- Subject: Unit docker.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit docker.service has begun starting up.
Jun 19 16:16:03 <hostname> dockerd[101915]: time="2018-06-19T16:16:03.782937628Z" level=info msg="libcontainerd: new containerd process, pid: 101927"
Jun 19 16:16:04 <hostname> dockerd[101915]: time="2018-06-19T16:16:04.786914140Z" level=warning msg="failed to rename /data/docker/tmp for background deletion: %!s(<nil>). Deleting synchronously"
Jun 19 16:16:04 <hostname> dockerd[101915]: time="2018-06-19T16:16:04.805038190Z" level=warning msg="devmapper: Usage of loopback devices is strongly discouraged for production use. Please use `-
Jun 19 16:16:04 <hostname> dockerd[101915]: time="2018-06-19T16:16:04.844206458Z" level=warning msg="devmapper: Base device already exists and has filesystem xfs on it. User specified filesystem
Jun 19 16:16:04 <hostname> dockerd[101915]: time="2018-06-19T16:16:04.865367062Z" level=info msg="[graphdriver] using prior storage driver: devicemapper"
Jun 19 16:16:04 <hostname> kernel: dev_remove: 27 callbacks suppressed
Jun 19 16:16:10 <hostname> kernel: dev_remove: 41 callbacks suppressed
Jun 19 16:16:15 <hostname> kernel: dev_remove: 41 callbacks suppressed
Jun 19 16:16:17 <hostname> sudo[101961]: <username> : TTY=pts/1 ; PWD=/home/<username> ; USER=root ; COMMAND=/usr/bin/journalctl -xeIt looks like the root cause is the line <code>Jun 19 16:16:03 <hostname> dockerd[101416]: Error starting daemon: error while opening volume store metadata database: invalid database</code>.
根本原因看起来像journalctl Jun 19 16:16:03 dockerd[101416]: Error starting daemon: error while opening volume store metadata database: invalid database
中的那一行。
我正在使用Docker版本17.05.0-ce,内部版本89658be。
有什么办法可以备份守护程序或挽救我的容器和卷?