我的 centos7 机器上有一个运行良好的 docker。意外硬重启后,docker不想启动。正如我在日志中看到的那样,问题在于它的依赖 containerd.service。
我试图重新安装所有 docker 堆栈,但没有帮助。我不知道如何修复它。
容器化版本
containerd containerd.io 1.4.6 d71fcd7d8303cbf684402823e425e9dd2e99285d
码头工人版本
Client: Docker Engine - Community
Version: 20.10.7
API version: 1.41
Go version: go1.13.15
Git commit: f0df350
Built: Wed Jun 2 11:58:10 2021
OS/Arch: linux/amd64
Context: default
Experimental: true
Server: Docker Engine - Community
Engine:
Version: 20.10.7
API version: 1.41 (minimum version 1.12)
Go version: go1.13.15
Git commit: b0f5bc3
Built: Wed Jun 2 11:56:35 2021
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.4.6
GitCommit: d71fcd7d8303cbf684402823e425e9dd2e99285d
runc:
Version: 1.0.0-rc95
GitCommit: b9ee9c6314599f1b4a7f497e1f1f856fe433d3b7
docker-init:
Version: 0.19.0
GitCommit: de40ad0
journalctl -xe 日志
Jun 08 12:43:47 home-server polkitd[635]: Registered Authentication Agent for unix-process:14104:481136 (system bus name :1.51 [/usr/bin/pkttyagent --notify-fd 5 --fallback], object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8)
Jun 08 12:43:47 home-server systemd[1]: Starting containerd container runtime...
-- Subject: Unit containerd.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit containerd.service has begun starting up.
Jun 08 12:43:47 home-server containerd[14112]: time="2021-06-08T12:43:47.208018803+03:00" level=info msg="starting containerd" revision=d71fcd7d8303cbf684402823e425e9dd2e99285d version=1.4.6
Jun 08 12:43:47 home-server containerd[14112]: time="2021-06-08T12:43:47.239821318+03:00" level=info msg="loading plugin \"io.containerd.content.v1.content\"..." type=io.containerd.content.v1
Jun 08 12:43:47 home-server containerd[14112]: time="2021-06-08T12:43:47.239939838+03:00" level=info msg="loading plugin \"io.containerd.snapshotter.v1.aufs\"..." type=io.containerd.snapshotter.v1
Jun 08 12:43:47 home-server containerd[14112]: time="2021-06-08T12:43:47.242315881+03:00" level=info msg="skip loading plugin \"io.containerd.snapshotter.v1.aufs\"..." error="aufs is not supported (modprobe aufs failed: exit status 1 \"modprobe: FATAL: Module aufs not found.\\n\"): skip plugin" type=io.containerd.snapshotter.v1
Jun 08 12:43:47 home-server containerd[14112]: time="2021-06-08T12:43:47.242397737+03:00" level=info msg="loading plugin \"io.containerd.snapshotter.v1.devmapper\"..." type=io.containerd.snapshotter.v1
Jun 08 12:43:47 home-server containerd[14112]: time="2021-06-08T12:43:47.242438849+03:00" level=warning msg="failed to load plugin io.containerd.snapshotter.v1.devmapper" error="devmapper not configured"
Jun 08 12:43:47 home-server containerd[14112]: time="2021-06-08T12:43:47.242460624+03:00" level=info msg="loading plugin \"io.containerd.snapshotter.v1.native\"..." type=io.containerd.snapshotter.v1
Jun 08 12:43:47 home-server containerd[14112]: time="2021-06-08T12:43:47.242503120+03:00" level=info msg="loading plugin \"io.containerd.snapshotter.v1.overlayfs\"..." type=io.containerd.snapshotter.v1
Jun 08 12:43:47 home-server containerd[14112]: time="2021-06-08T12:43:47.242659189+03:00" level=info msg="loading plugin \"io.containerd.snapshotter.v1.zfs\"..." type=io.containerd.snapshotter.v1
Jun 08 12:43:47 home-server containerd[14112]: time="2021-06-08T12:43:47.242939650+03:00" level=info msg="skip loading plugin \"io.containerd.snapshotter.v1.zfs\"..." error="path /var/lib/containerd/io.containerd.snapshotter.v1.zfs must be a zfs filesystem to be used with the zfs snapshotter: skip plugin" type=io.containerd.snapshotter.v1
Jun 08 12:43:47 home-server containerd[14112]: time="2021-06-08T12:43:47.242969022+03:00" level=info msg="loading plugin \"io.containerd.metadata.v1.bolt\"..." type=io.containerd.metadata.v1
Jun 08 12:43:47 home-server containerd[14112]: time="2021-06-08T12:43:47.242999501+03:00" level=warning msg="could not use snapshotter devmapper in metadata plugin" error="devmapper not configured"
Jun 08 12:43:47 home-server containerd[14112]: time="2021-06-08T12:43:47.243017618+03:00" level=info msg="metadata content store policy set" policy=shared
Jun 08 12:43:47 home-server containerd[14112]: panic: runtime error: slice bounds out of range [::4294852604] with length 2147483647
Jun 08 12:43:47 home-server containerd[14112]: goroutine 1 [running]:
Jun 08 12:43:47 home-server containerd[14112]: github.com/containerd/containerd/vendor/go.etcd.io/bbolt.unsafeByteSlice(...)
Jun 08 12:43:47 home-server containerd[14112]: /go/src/github.com/containerd/containerd/vendor/go.etcd.io/bbolt/unsafe.go:27
Jun 08 12:43:47 home-server containerd[14112]: github.com/containerd/containerd/vendor/go.etcd.io/bbolt.(*leafPageElement).key(...)
Jun 08 12:43:47 home-server containerd[14112]: /go/src/github.com/containerd/containerd/vendor/go.etcd.io/bbolt/page.go:126
Jun 08 12:43:47 home-server containerd[14112]: github.com/containerd/containerd/vendor/go.etcd.io/bbolt.(*Cursor).nsearch.func2(0x6b8a, 0xc0000d7e00)
Jun 08 12:43:47 home-server containerd[14112]: /go/src/github.com/containerd/containerd/vendor/go.etcd.io/bbolt/cursor.go:328 +0xc5
Jun 08 12:43:47 home-server containerd[14112]: sort.Search(0x6c62, 0xc0005f1dd8, 0x0)
Jun 08 12:43:47 home-server containerd[14112]: /usr/local/go/src/sort/search.go:66 +0x5a
Jun 08 12:43:47 home-server containerd[14112]: github.com/containerd/containerd/vendor/go.etcd.io/bbolt.(*Cursor).nsearch(0xc0005f1fb8, 0xc0005f2090, 0x2, 0x20)
Jun 08 12:43:47 home-server containerd[14112]: /go/src/github.com/containerd/containerd/vendor/go.etcd.io/bbolt/cursor.go:327 +0x104
Jun 08 12:43:47 home-server containerd[14112]: github.com/containerd/containerd/vendor/go.etcd.io/bbolt.(*Cursor).search(0xc0005f1fb8, 0xc0005f2090, 0x2, 0x20, 0x36)
Jun 08 12:43:47 home-server containerd[14112]: /go/src/github.com/containerd/containerd/vendor/go.etcd.io/bbolt/cursor.go:257 +0x1cc
Jun 08 12:43:47 home-server containerd[14112]: github.com/containerd/containerd/vendor/go.etcd.io/bbolt.(*Cursor).seek(0xc0005f1fb8, 0xc0005f2090, 0x2, 0x20, 0x55a2762027a0, 0x55a273ab2342, 0xc00000f5e0, 0x20, 0x18, 0x55a2753203e0, ...)
Jun 08 12:43:47 home-server containerd[14112]: /go/src/github.com/containerd/containerd/vendor/go.etcd.io/bbolt/cursor.go:159 +0x7f
Jun 08 12:43:47 home-server containerd[14112]: github.com/containerd/containerd/vendor/go.etcd.io/bbolt.(*Bucket).Bucket(0xc000322018, 0xc0005f2090, 0x2, 0x20, 0x2)
Jun 08 12:43:47 home-server containerd[14112]: /go/src/github.com/containerd/containerd/vendor/go.etcd.io/bbolt/bucket.go:105 +0xd6
Jun 08 12:43:47 home-server containerd[14112]: github.com/containerd/containerd/vendor/go.etcd.io/bbolt.(*Tx).Bucket(...)
Jun 08 12:43:47 home-server containerd[14112]: /go/src/github.com/containerd/containerd/vendor/go.etcd.io/bbolt/tx.go:101
Jun 08 12:43:47 home-server containerd[14112]: github.com/containerd/containerd/metadata.(*DB).Init.func1(0xc000322000, 0x55a273ab2b01, 0xc000322000)
Jun 08 12:43:47 home-server containerd[14112]: /go/src/github.com/containerd/containerd/metadata/db.go:150 +0x161
Jun 08 12:43:47 home-server containerd[14112]: github.com/containerd/containerd/vendor/go.etcd.io/bbolt.(*DB).Update(0xc0000ce200, 0xc0005f2368, 0x0, 0x0)
Jun 08 12:43:47 home-server containerd[14112]: /go/src/github.com/containerd/containerd/vendor/go.etcd.io/bbolt/db.go:694 +0xaa
Jun 08 12:43:47 home-server containerd[14112]: github.com/containerd/containerd/metadata.(*DB).Init(0xc0000acc40, 0x55a2755dc4c0, 0xc000040018, 0xc0005f2520, 0x0)
Jun 08 12:43:47 home-server systemd[1]: containerd.service: main process exited, code=exited, status=2/INVALIDARGUMENT
Jun 08 12:43:47 home-server containerd[14112]: /go/src/github.com/containerd/containerd/metadata/db.go:132 +0xdc
Jun 08 12:43:47 home-server containerd[14112]: github.com/containerd/containerd/services/server.LoadPlugins.func2(0xc000330300, 0x0, 0x0, 0x0, 0x0)
Jun 08 12:43:47 home-server containerd[14112]: /go/src/github.com/containerd/containerd/services/server/server.go:390 +0x933
Jun 08 12:43:47 home-server containerd[14112]: github.com/containerd/containerd/plugin.(*Registration).Init(0xc00039c960, 0xc000330300, 0x55a27535b5a0)
Jun 08 12:43:47 home-server containerd[14112]: /go/src/github.com/containerd/containerd/plugin/plugin.go:110 +0x3a
Jun 08 12:43:47 home-server containerd[14112]: github.com/containerd/containerd/services/server.New(0x55a2755dc4c0, 0xc000040018, 0xc0002fa600, 0x1, 0x1, 0xc000396540)
Jun 08 12:43:47 home-server containerd[14112]: /go/src/github.com/containerd/containerd/services/server/server.go:168 +0xcaa
Jun 08 12:43:47 home-server containerd[14112]: github.com/containerd/containerd/cmd/containerd/command.App.func1(0xc0003ee160, 0x0, 0xc0003dc9c0)
Jun 08 12:43:47 home-server containerd[14112]: /go/src/github.com/containerd/containerd/cmd/containerd/command/main.go:177 +0x7fa
Jun 08 12:43:47 home-server containerd[14112]: github.com/containerd/containerd/vendor/github.com/urfave/cli.HandleAction(0x55a2752fe300, 0x55a275576e00, 0xc0003ee160, 0xc0003ee160, 0x0)
Jun 08 12:43:47 home-server containerd[14112]: /go/src/github.com/containerd/containerd/vendor/github.com/urfave/cli/app.go:523 +0xc0
Jun 08 12:43:47 home-server containerd[14112]: github.com/containerd/containerd/vendor/github.com/urfave/cli.(*App).Run(0xc00041e000, 0xc00003c1d0, 0x1, 0x1, 0x0, 0x0)
Jun 08 12:43:47 home-server containerd[14112]: /go/src/github.com/containerd/containerd/vendor/github.com/urfave/cli/app.go:285 +0x5e1
Jun 08 12:43:47 home-server containerd[14112]: main.main()
Jun 08 12:43:47 home-server containerd[14112]: github.com/containerd/containerd/cmd/containerd/main.go:33 +0x51
Jun 08 12:43:47 home-server systemd[1]: Failed to start containerd container runtime.
-- Subject: Unit containerd.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit containerd.service has failed.
--
-- The result is failed.
Jun 08 12:43:47 home-server systemd[1]: Unit containerd.service entered failed state.
Jun 08 12:43:47 home-server systemd[1]: containerd.service failed.
我可以手动启动docker:/usr/bin/dockerd -H unix://
INFO[2021-06-08T12:52:53.394123268+03:00] Starting up
INFO[2021-06-08T12:52:53.397322554+03:00] libcontainerd: started new containerd process pid=15865
INFO[2021-06-08T12:52:53.397400439+03:00] parsed scheme: "unix" module=grpc
INFO[2021-06-08T12:52:53.397418550+03:00] scheme "unix" not registered, fallback to default scheme module=grpc
INFO[2021-06-08T12:52:53.397449052+03:00] ccResolverWrapper: sending update to cc: {[{unix:///var/run/docker/containerd/containerd.sock <nil> 0 <nil>}] <nil> <nil>} module=grpc
INFO[2021-06-08T12:52:53.397467226+03:00] ClientConn switching balancer to "pick_first" module=grpc
INFO[2021-06-08T12:52:53.429979101+03:00] starting containerd revision=d71fcd7d8303cbf684402823e425e9dd2e99285d version=1.4.6
INFO[2021-06-08T12:52:53.464123200+03:00] loading plugin "io.containerd.content.v1.content"... type=io.containerd.content.v1
INFO[2021-06-08T12:52:53.464210829+03:00] loading plugin "io.containerd.snapshotter.v1.aufs"... type=io.containerd.snapshotter.v1
INFO[2021-06-08T12:52:53.471152320+03:00] skip loading plugin "io.containerd.snapshotter.v1.aufs"... error="aufs is not supported (modprobe aufs failed: exit status 1 \"modprobe: FATAL: Module aufs not found.\\n\"): skip plugin" type=io.containerd.snapshotter.v1
INFO[2021-06-08T12:52:53.471210656+03:00] loading plugin "io.containerd.snapshotter.v1.devmapper"... type=io.containerd.snapshotter.v1
WARN[2021-06-08T12:52:53.471251790+03:00] failed to load plugin io.containerd.snapshotter.v1.devmapper error="devmapper not configured"
INFO[2021-06-08T12:52:53.471272725+03:00] loading plugin "io.containerd.snapshotter.v1.native"... type=io.containerd.snapshotter.v1
INFO[2021-06-08T12:52:53.471411798+03:00] loading plugin "io.containerd.snapshotter.v1.overlayfs"... type=io.containerd.snapshotter.v1
INFO[2021-06-08T12:52:53.471708157+03:00] loading plugin "io.containerd.snapshotter.v1.zfs"... type=io.containerd.snapshotter.v1
INFO[2021-06-08T12:52:53.471923451+03:00] skip loading plugin "io.containerd.snapshotter.v1.zfs"... error="path /var/lib/docker/containerd/daemon/io.containerd.snapshotter.v1.zfs must be a zfs filesystem to be used with the zfs snapshotter: skip plugin" type=io.containerd.snapshotter.v1
INFO[2021-06-08T12:52:53.471952961+03:00] loading plugin "io.containerd.metadata.v1.bolt"... type=io.containerd.metadata.v1
WARN[2021-06-08T12:52:53.471980179+03:00] could not use snapshotter devmapper in metadata plugin error="devmapper not configured"
INFO[2021-06-08T12:52:53.471998910+03:00] metadata content store policy set policy=shared
INFO[2021-06-08T12:52:53.472303026+03:00] loading plugin "io.containerd.differ.v1.walking"... type=io.containerd.differ.v1
INFO[2021-06-08T12:52:53.472334773+03:00] loading plugin "io.containerd.gc.v1.scheduler"... type=io.containerd.gc.v1
INFO[2021-06-08T12:52:53.472743775+03:00] loading plugin "io.containerd.service.v1.introspection-service"... type=io.containerd.service.v1
INFO[2021-06-08T12:52:53.472798745+03:00] loading plugin "io.containerd.service.v1.containers-service"... type=io.containerd.service.v1
INFO[2021-06-08T12:52:53.472823259+03:00] loading plugin "io.containerd.service.v1.content-service"... type=io.containerd.service.v1
INFO[2021-06-08T12:52:53.472853922+03:00] loading plugin "io.containerd.service.v1.diff-service"... type=io.containerd.service.v1
INFO[2021-06-08T12:52:53.472881393+03:00] loading plugin "io.containerd.service.v1.images-service"... type=io.containerd.service.v1
INFO[2021-06-08T12:52:53.472903888+03:00] loading plugin "io.containerd.service.v1.leases-service"... type=io.containerd.service.v1
INFO[2021-06-08T12:52:53.472932126+03:00] loading plugin "io.containerd.service.v1.namespaces-service"... type=io.containerd.service.v1
INFO[2021-06-08T12:52:53.472959061+03:00] loading plugin "io.containerd.service.v1.snapshots-service"... type=io.containerd.service.v1
INFO[2021-06-08T12:52:53.472980888+03:00] loading plugin "io.containerd.runtime.v1.linux"... type=io.containerd.runtime.v1
INFO[2021-06-08T12:52:53.473246754+03:00] loading plugin "io.containerd.runtime.v2.task"... type=io.containerd.runtime.v2
INFO[2021-06-08T12:52:53.473425271+03:00] loading plugin "io.containerd.monitor.v1.cgroups"... type=io.containerd.monitor.v1
INFO[2021-06-08T12:52:53.474155627+03:00] loading plugin "io.containerd.service.v1.tasks-service"... type=io.containerd.service.v1
INFO[2021-06-08T12:52:53.474201394+03:00] loading plugin "io.containerd.internal.v1.restart"... type=io.containerd.internal.v1
INFO[2021-06-08T12:52:53.474276941+03:00] loading plugin "io.containerd.grpc.v1.containers"... type=io.containerd.grpc.v1
INFO[2021-06-08T12:52:53.474305096+03:00] loading plugin "io.containerd.grpc.v1.content"... type=io.containerd.grpc.v1
INFO[2021-06-08T12:52:53.474331423+03:00] loading plugin "io.containerd.grpc.v1.diff"... type=io.containerd.grpc.v1
INFO[2021-06-08T12:52:53.474353052+03:00] loading plugin "io.containerd.grpc.v1.events"... type=io.containerd.grpc.v1
INFO[2021-06-08T12:52:53.474373937+03:00] loading plugin "io.containerd.grpc.v1.healthcheck"... type=io.containerd.grpc.v1
INFO[2021-06-08T12:52:53.474396265+03:00] loading plugin "io.containerd.grpc.v1.images"... type=io.containerd.grpc.v1
INFO[2021-06-08T12:52:53.474416800+03:00] loading plugin "io.containerd.grpc.v1.leases"... type=io.containerd.grpc.v1
INFO[2021-06-08T12:52:53.474437266+03:00] loading plugin "io.containerd.grpc.v1.namespaces"... type=io.containerd.grpc.v1
INFO[2021-06-08T12:52:53.474458452+03:00] loading plugin "io.containerd.internal.v1.opt"... type=io.containerd.internal.v1
INFO[2021-06-08T12:52:53.474571938+03:00] loading plugin "io.containerd.grpc.v1.snapshots"... type=io.containerd.grpc.v1
INFO[2021-06-08T12:52:53.474639409+03:00] loading plugin "io.containerd.grpc.v1.tasks"... type=io.containerd.grpc.v1
INFO[2021-06-08T12:52:53.474664963+03:00] loading plugin "io.containerd.grpc.v1.version"... type=io.containerd.grpc.v1
INFO[2021-06-08T12:52:53.474686545+03:00] loading plugin "io.containerd.grpc.v1.introspection"... type=io.containerd.grpc.v1
INFO[2021-06-08T12:52:53.474997844+03:00] serving... address=/var/run/docker/containerd/containerd-debug.sock
INFO[2021-06-08T12:52:53.475119650+03:00] serving... address=/var/run/docker/containerd/containerd.sock.ttrpc
INFO[2021-06-08T12:52:53.475217839+03:00] serving... address=/var/run/docker/containerd/containerd.sock
INFO[2021-06-08T12:52:53.475246761+03:00] containerd successfully booted in 0.046036s
INFO[2021-06-08T12:52:53.488909833+03:00] parsed scheme: "unix" module=grpc
INFO[2021-06-08T12:52:53.488941842+03:00] scheme "unix" not registered, fallback to default scheme module=grpc
INFO[2021-06-08T12:52:53.488965583+03:00] ccResolverWrapper: sending update to cc: {[{unix:///var/run/docker/containerd/containerd.sock <nil> 0 <nil>}] <nil> <nil>} module=grpc
INFO[2021-06-08T12:52:53.488983253+03:00] ClientConn switching balancer to "pick_first" module=grpc
INFO[2021-06-08T12:52:53.496852034+03:00] parsed scheme: "unix" module=grpc
INFO[2021-06-08T12:52:53.496886947+03:00] scheme "unix" not registered, fallback to default scheme module=grpc
INFO[2021-06-08T12:52:53.496912640+03:00] ccResolverWrapper: sending update to cc: {[{unix:///var/run/docker/containerd/containerd.sock <nil> 0 <nil>}] <nil> <nil>} module=grpc
INFO[2021-06-08T12:52:53.496927542+03:00] ClientConn switching balancer to "pick_first" module=grpc
INFO[2021-06-08T12:52:53.506089633+03:00] [graphdriver] using prior storage driver: overlay2
INFO[2021-06-08T12:52:53.517972059+03:00] Loading containers: start.
INFO[2021-06-08T12:52:53.542940022+03:00] Firewalld: docker zone already exists, returning
INFO[2021-06-08T12:52:53.814808470+03:00] Firewalld: interface br-fd72b0a44d95 already part of docker zone, returning
INFO[2021-06-08T12:52:53.848057121+03:00] Firewalld: interface br-fd72b0a44d95 already part of docker zone, returning
INFO[2021-06-08T12:52:53.991332133+03:00] Firewalld: interface docker0 already part of docker zone, returning
INFO[2021-06-08T12:52:54.036886093+03:00] Firewalld: interface docker0 already part of docker zone, returning
INFO[2021-06-08T12:52:54.328028926+03:00] Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. Daemon option --bip can be used to set a preferred IP address
INFO[2021-06-08T12:52:54.456083410+03:00] Firewalld: interface docker0 already part of docker zone, returning
INFO[2021-06-08T12:52:54.587976757+03:00] Loading containers: done.
INFO[2021-06-08T12:52:54.614406778+03:00] Docker daemon commit=b0f5bc3 graphdriver(s)=overlay2 version=20.10.7
INFO[2021-06-08T12:52:54.614490617+03:00] Daemon has completed initialization
INFO[2021-06-08T12:52:54.645839891+03:00] API listen on /var/run/docker.sock