为什么`docker stop`会杀死docker服务?

时间:2015-07-29 17:03:51

标签: jenkins docker

我们的CI基础架构(Jenkins)构建并测试docker容器。我们发现停止测试期间使用的容器会使docker服务脱机,从而将slave与Jenkins master断开连接。为什么要停止memcached容器杀死并重新启动docker服务?

我们在工作中看到的是什么:

+ docker stop memcached55c7e2ab363be9425039412edc81be1e8601c196
FATAL: java.io.IOException: Unexpected termination of the channel
hudson.remoting.RequestAbortedException: java.io.IOException: Unexpected termination of the channel
    at hudson.remoting.Request.abort(Request.java:295)
    at hudson.remoting.Channel.terminate(Channel.java:814)

的/ var /日志/搬运工:

time="2015-07-29T11:43:07-04:00" level=info msg="POST /v1.18/containers/memcached55c7e2ab363be9425039412edc81be1e8601c196/stop?t=10" 
time="2015-07-29T11:43:07-04:00" level=info msg="+job stop(memcached55c7e2ab363be9425039412edc81be1e8601c196)" 
\nWed Jul 29 11:43:52 EDT 2015\n
time="2015-07-29T11:43:53-04:00" level=warning msg="You are running linux kernel version 2.6.32-504.30.3.el6.x86_64, which might be unstable running docker. Please upgrade your kernel to 3.8.0." 
time="2015-07-29T11:43:53-04:00" level=info msg="+job serveapi(unix:///var/run/docker.sock)" 
time="2015-07-29T11:43:53-04:00" level=info msg="Listening for HTTP on unix (/var/run/docker.sock)" 
time="2015-07-29T11:43:53-04:00" level=info msg="+job init_networkdriver()" 
time="2015-07-29T11:43:53-04:00" level=info msg="-job init_networkdriver() = OK (0)" 
time="2015-07-29T11:43:53-04:00" level=info msg="Loading containers: start." 
...time="2015-07-29T11:43:53-04:00" level=error msg="Error unmounting device 23607b95df9a186d80bb346c914cd01e7631c4fec3968bde29df7bc327f0b820: UnmountDevice: device not-mounted id 23607b95df9a186d80bb346c914cd01e7631c4fec3968bde29df7bc327f0b820" 
.time="2015-07-29T11:43:53-04:00" level=error msg="Error unmounting device d01f73b589a9d598cc97752ce554b5c5dcf1b51d3991c1dee54880bb7d718fb7: UnmountDevice: device not-mounted id d01f73b589a9d598cc97752ce554b5c5dcf1b51d3991c1dee54880bb7d718fb7" 

time="2015-07-29T11:43:53-04:00" level=info msg="Loading containers: done." 
time="2015-07-29T11:43:53-04:00" level=info msg="docker daemon: 1.6.2 7c8fca2/1.6.2; execdriver: native-0.2; graphdriver: devicemapper" 
time="2015-07-29T11:43:53-04:00" level=info msg="+job acceptconnections()" 
time="2015-07-29T11:43:53-04:00" level=info msg="-job acceptconnections() = OK (0)" 
time="2015-07-29T11:43:53-04:00" level=info msg="Daemon has completed initialization" 

版本:

-bash-4.1$ uname -a
Linux ip-172-17-70-142.ec2.internal 2.6.32-504.30.3.el6.x86_64 #1 SMP Wed Jul 15 10:13:09 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
-bash-4.1$ docker --version
Docker version 1.6.2, build 7c8fca2/1.6.2
-bash-4.1$ docker version
Client version: 1.6.2
Client API version: 1.18
Go version (client): go1.4.2
Git commit (client): 7c8fca2/1.6.2
OS/Arch (client): linux/amd64
Server version: 1.6.2
Server API version: 1.18
Go version (server): go1.4.2
Git commit (server): 7c8fca2/1.6.2
OS/Arch (server): linux/amd64
-bash-4.1$ docker info
Containers: 2
Images: 65
Storage Driver: devicemapper
 Pool Name: docker-202:64-936887-pool
 Pool Blocksize: 65.54 kB
 Backing Filesystem: extfs
 Data file: /dev/loop0
 Metadata file: /dev/loop1
 Data Space Used: 1.597 GB
 Data Space Total: 107.4 GB
 Data Space Available: 12.44 GB
 Metadata Space Used: 3.584 MB
 Metadata Space Total: 2.147 GB
 Metadata Space Available: 2.144 GB
 Udev Sync Supported: true
 Data loop file: /var/lib/docker/devicemapper/devicemapper/data
 Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata
 Library Version: 1.02.89-RHEL6 (2014-09-01)
Execution Driver: native-0.2
Kernel Version: 2.6.32-504.30.3.el6.x86_64
Operating System: <unknown>
CPUs: 2
Total Memory: 7.166 GiB
Name: ip-172-17-70-142.ec2.internal
ID: X4UG:BKKW:5ZQX:VXRV:3GYP:FU3J:7FJC:4FFM:CK4D:SWSH:KIHW:IPNE
Username: dxbuildmaster
Registry: [https://index.docker.io/v1/]

1 个答案:

答案 0 :(得分:0)

你确定这是由码头引起的吗?我们在我们的环境中使用的Jenkins版本根本没有处理docker并且有相同的错误消息。有一个known Jenkins bug左右,已在1.532.1版本中修复。你使用哪种Jenkins版本?