我有一台运行Ubuntu 18.04.2 LTS且具有最新更新的服务器。我使用https://docs.docker.com/install/linux/docker-ce/ubuntu/
中的教程使用回购协议安装了docker-ce启动后不久,docker守护进程被某种方式杀死。要调试,我运行了
/usr/bin/dockerd
以root身份获取日志输出:
root@hostname ~ # /usr/bin/dockerd
INFO[2019-02-21T17:20:15.233508941+01:00] systemd-resolved is running, so using resolvconf: /run/systemd/resolve/resolv.conf
INFO[2019-02-21T17:20:15.235533437+01:00] parsed scheme: "unix" module=grpc
INFO[2019-02-21T17:20:15.235562227+01:00] scheme "unix" not registered, fallback to default scheme module=grpc
INFO[2019-02-21T17:20:15.235594491+01:00] parsed scheme: "unix" module=grpc
INFO[2019-02-21T17:20:15.235601292+01:00] scheme "unix" not registered, fallback to default scheme module=grpc
INFO[2019-02-21T17:20:15.239064773+01:00] ccResolverWrapper: sending new addresses to cc: [{unix:///run/containerd/containerd.sock 0 <nil>}] module=grpc
INFO[2019-02-21T17:20:15.239098425+01:00] ClientConn switching balancer to "pick_first" module=grpc
INFO[2019-02-21T17:20:15.239155494+01:00] pickfirstBalancer: HandleSubConnStateChange: 0xc42018d430, CONNECTING module=grpc
INFO[2019-02-21T17:20:15.239321579+01:00] pickfirstBalancer: HandleSubConnStateChange: 0xc42018d430, READY module=grpc
INFO[2019-02-21T17:20:15.240106192+01:00] ccResolverWrapper: sending new addresses to cc: [{unix:///run/containerd/containerd.sock 0 <nil>}] module=grpc
INFO[2019-02-21T17:20:15.240142826+01:00] ClientConn switching balancer to "pick_first" module=grpc
INFO[2019-02-21T17:20:15.240193046+01:00] pickfirstBalancer: HandleSubConnStateChange: 0xc4207c2120, CONNECTING module=grpc
INFO[2019-02-21T17:20:15.240315657+01:00] pickfirstBalancer: HandleSubConnStateChange: 0xc4207c2120, READY module=grpc
INFO[2019-02-21T17:20:15.243221391+01:00] [graphdriver] using prior storage driver: overlay2
INFO[2019-02-21T17:20:15.275042317+01:00] Graph migration to content-addressability took 0.00 seconds
WARN[2019-02-21T17:20:15.275313782+01:00] Your kernel does not support swap memory limit
WARN[2019-02-21T17:20:15.275355076+01:00] Your kernel does not support cgroup rt period
WARN[2019-02-21T17:20:15.275369332+01:00] Your kernel does not support cgroup rt runtime
INFO[2019-02-21T17:20:15.275785076+01:00] Loading containers: start.
INFO[2019-02-21T17:20:16.335203892+01: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[2019-02-21T17:20:16.683066803+01:00] Loading containers: done.
INFO[2019-02-21T17:20:16.835625998+01:00] Docker daemon commit=6247962 graphdriver(s)=overlay2 version=18.09.2
INFO[2019-02-21T17:20:16.835701364+01:00] Daemon has completed initialization
INFO[2019-02-21T17:20:16.842961863+01:00] API listen on /var/run/docker.sock
Killed
如您所见,有两种警告(我认为它们是不相关的),最后有一条有关杀戮的消息。守护程序的运行时间约为一分钟。
我之前已经在这台机器上(使用docker.io)安装了docker,但是我倾向于清除所有数据包,删除了/ var,/ etc和/ home和/ run中所有与docker相关的文件,并执行了系统范围的搜索其中包含*docker*
的任何文件。问题仍然存在。我该如何进一步调试并找出为什么docker守护程序一直被杀死?
答案 0 :(得分:0)
检查/var/log/kern.log以查看docker daemon被杀死的原因。如果是关于OOM杀手(内存不足杀手)的触发,则系统上没有足够的内存。添加更多RAM或交换内存。