docker swarm 查看service无法启动的错误信息

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

当运行docker stack deploy -c xxxxx.yml stack_name命令后,有时会遇到某些服务无法正常启动容器,可通过以下命令查看信息:

docker service ps --no-trunc {serviceName}

执行命令后会看到如下类似的错误信息:

[root@manager crs2sc]# docker service ps  shd_cfg2 --no-trunc
ID                          NAME                IMAGE                                                                                  NODE                DESIRED STATE       CURRENT STATE            ERROR                                                                                                   PORTS
q878gbecak71uujkotzojak15   shd_cfg2.1          mongo:latest@sha256:472a6b9bc30cc086cdda92eb25f0ae0f78afccb4ae6d50be6c05c9bb0ac2ca14   worker1             Running             Running 38 seconds ago                                                                                                           
xizbvq4h7kyl1eelomfzjg6bk    \_ shd_cfg2.1      mongo:latest@sha256:472a6b9bc30cc086cdda92eb25f0ae0f78afccb4ae6d50be6c05c9bb0ac2ca14   worker1             Shutdown            Rejected 5 minutes ago   "No such image: mongo:latest@sha256:472a6b9bc30cc086cdda92eb25f0ae0f78afccb4ae6d50be6c05c9bb0ac2ca14"   
z86jb8nbyamag0rvd5dhv8tbi    \_ shd_cfg2.1      mongo:latest@sha256:472a6b9bc30cc086cdda92eb25f0ae0f78afccb4ae6d50be6c05c9bb0ac2ca14   worker1             Shutdown            Rejected 6 minutes ago   "No such image: mongo:latest@sha256:472a6b9bc30cc086cdda92eb25f0ae0f78afccb4ae6d50be6c05c9bb0ac2ca14"   

从信息可以看出docker镜像有问题,重新pull镜像便解决问题。

转载于:https://my.oschina.net/jennerlo/blog/3043350

你可能感兴趣的:(docker swarm 查看service无法启动的错误信息)