当前位置: 动力学知识库 > 问答 > 编程问答 >

docker - How can I identify why my replica's are not starting in the swarm?

问题描述:

I have used the following docker swarm command within my manager node to deploy my application.

$ docker stack deploy --compose-file docker-stack.yml sb

Here is the docker-stack.yml file.

version: "3"

services:

db:

image: postgres:9.4

volumes:

- db-data:/var/lib/postgresql/data

networks:

- backend

deploy:

placement:

constraints: [node.role == manager]

sample_blog:

image: quay.io/repository/copley/sample_blog

ports:

- 3000:80

networks:

- frontend

deploy:

replicas: 2

update_config:

parallelism: 2

restart_policy:

condition: on-failure

networks:

frontend:

backend:

volumes:

db-data:

This is the output when I run the command:

$ docker service ls

ID NAME MODE REPLICAS IMAGE

dingz17v0qor sb_db replicated 0/1 postgres:9.4

tq3lgqvwx627 sb_sample_blog replicated 0/2 quay.io/repository/copley/sample_blog

Why are my replica's not starting? I have waited over 20minutes.

分享给朋友:
您可能感兴趣的文章:
随机阅读: