docker swarm如何查看service无法启动的错误信息
更新:HHH   时间:2023-1-7


这篇文章给大家分享的是有关docker swarm如何查看service无法启动的错误信息的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。

当运行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镜像便解决问题。

感谢各位的阅读!关于“docker swarm如何查看service无法启动的错误信息”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,让大家可以学到更多知识,如果觉得文章不错,可以把它分享出去让更多的人看到吧!

返回云计算教程...