无法终止进程(源自docker容器)

我运行一个有几千个容器的Docker集群,每天随机运行几次,我有一个进程阻塞容器停止。 下面是一个示例容器,其相应的过程和所有我试图杀死容器/进程的东西。

容器:

# docker ps | grep 950677e2317f 950677e2317f 7e553d1d9f6f "/bin/sh -c /minecraf" 2 days ago Up 2 days 0.0.0.0:22661->22661/tcp, 0.0.0.0:22661->22661/udp, 0.0.0.0:37681->37681/tcp, 0.0.0.0:37681->37681/udp gloomy_jennings 

尝试使用docker守护进程停止容器(它会永远尝试没有结果):

 # time docker stop --time=1 950677e2317f ^C real 0m13.508s user 0m0.036s sys 0m0.008s 

守护进程尝试停止时logging日志:

 # journalctl -fu docker.service -- Logs begin at Fri 2015-12-11 15:40:55 CET. -- Dec 31 23:30:33 m3561.contabo.host docker[9988]: time="2015-12-31T23:30:33.164731953+01:00" level=info msg="POST /v1.21/containers/950677e2317f/stop?t=1" Dec 31 23:30:34 m3561.contabo.host docker[9988]: time="2015-12-31T23:30:34.165531990+01:00" level=info msg="Container 950677e2317fcd2403ef5b5ffad37204e880136e91f76b0a8682e04a93e80942 failed to exit within 1 seconds of SIGTERM - using the force" Dec 31 23:30:44 m3561.contabo.host docker[9988]: time="2015-12-31T23:30:44.165954266+01:00" level=info msg="Container 950677e2317f failed to exit within 10 seconds of kill - trying direct SIGKILL" 

查看在机器上运行的进程显示僵尸进程(主机上的pid 11991):

 # ps aux | grep [1]1991 root 11991 84.3 0.0 5836 132 ? R Dec30 1300:19 bash -c (echo stop > /tmp/minecraft &) # top -b | grep [1]1991 11991 root 20 0 5836 132 20 R 89.5 0.0 1300:29 bash 

它确实是一个在我们的容器中运行的进程(检查容器ID):

 # cat /proc/11991/mountinfo ... /var/lib/docker/containers/950677e2317fcd2403ef5b5ffad37204e880136e91f76b0a8682e04a93e80942/resolv.conf /etc/resolv.conf rw,relatime - ext4 /dev/sda2 rw,errors=remount-ro,data=ordered 

试图杀死进程没有产生任何东西:

 # kill -9 11991 # ps aux | grep [1]1991 root 11991 84.3 0.0 5836 132 ? R Dec30 1303:58 bash -c (echo stop > /tmp/minecraft &) 

一些概述数据:

 # docker version Client: Version: 1.9.1 API version: 1.21 Go version: go1.4.2 Git commit: a34a1d5 Built: Fri Nov 20 13:20:08 UTC 2015 OS/Arch: linux/amd64 Server: Version: 1.9.1 API version: 1.21 Go version: go1.4.2 Git commit: a34a1d5 Built: Fri Nov 20 13:20:08 UTC 2015 OS/Arch: linux/amd64 # docker info Containers: 189 Images: 322 Server Version: 1.9.1 Storage Driver: aufs Root Dir: /var/lib/docker/aufs Backing Filesystem: extfs Dirs: 700 Dirperm1 Supported: true Execution Driver: native-0.2 Logging Driver: json-file Kernel Version: 4.2.0-19-generic Operating System: Ubuntu 15.10 CPUs: 24 Total Memory: 125.8 GiB Name: m3561.contabo.host ID: ZM2Q:RA6Q:E4NM:5Q2Q:R7E4:BFPQ:EEVK:7MEO:YRH6:SVS6:RIHA:3I2K # uname -a Linux m3561.contabo.host 4.2.0-19-generic #23-Ubuntu SMP Wed Nov 11 11:39:30 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux 

如果停止docker守护进程,这个过程仍然存在。 摆脱这个过程的唯一方法是重新启动主机。 由于这种情况发生得相当频繁(每3-7天需要每个节点重新启动一次),这会严重影响整个集群的正常运行时间。

任何想法在这里做什么?

好吧,我想我find了这个根本原因。 在Docker的人帮了我,在GitHub上看看这个线程。

事实certificate这很可能是Linux Kernel 4.19+中的一个错误。 我会回滚到一个较旧的版本,直到它被修复。

更新:我已经运行了3. *只有在我的集群几天,现在没有任何问题。 这肯定是一个内核错误。

我有一个类似的问题, 切换到使用overlay2存储驱动程序使问题消失。 更改存储驱动程序将会释放所有泊坞窗状态(图像和容器)。 似乎aufs存储驱动程序有一些问题,可能是locking的来源。