创建于Docker Swarm的服务无法在Ubuntu 14.04 LTS中运行

V秘团队一直致力于用技术改善产品。V秘后台的各种服务一直是通过完善的Devops流程自动部署到Docker容器集群。随着Swarm modeDocker v1.12中正式发布,Swarm mode带来了诸如Docker集群,多主机网络等激动人心的特性。我们也在尝试将V秘服务部署到Docker Swarm Cluster获取更好的弹性计算能力。

然而我们将V秘的服务部署到Docker Swarm Cluster时遇到服务容器无法启动的错误。错误信息类似如下,

starting container failed: could not add veth pair inside the network sandbox: could not find an appropriate master "ov-000100-1wkbc" for "vethee39f9d"

经过与Docker 社区的回馈讨论,暂时通过升级Docker主机(OS: Ubuntu 14.04 LTS)的内核版本解决了这个错误。

具体方法如下,

1root@swarm1:~# uname -r 
23.13.0-32-generic
3
4root@swarm1:~# apt-get install linux-generic-lts-vivid
5root@swarm1:~# reboot
6
7root@swarm1:~# uname -r
83.19.0-69-generic

至于这个错误的根本原因是Docker的bug还是对Linux Kernel有特殊的要求,需要Docker开发进一步确认。如果对此问题有更多兴趣,可以关注docker issue #25039