Akshay Sood
Akshay Sood

Reputation: 6776

Docker Swarm: deploy containers on Worker node

I am trying to deploy the application on multiple instances. On master node, I used these bunch of commands:

And the service was deployed on master node and is running properly.

Now I have another compose file named: docker-compose-orderer.yaml Which I want to deploy on other AWS instance.

I used the following command on worker node:

It command docker stack deploy --compose-file docker-compose-org1.yaml fabric says this node is not a swarm manager. Use "docker swarm init" or "docker swarm join" to connect this node to swarm and try again

Does anyone knows how to deploy the compose file in worker node?

Any help/suggestion would be appreciated.

Update 1:

Worker node joined swarm manager successfully.

ID                            HOSTNAME            STATUS              AVAILABILITY        MANAGER STATUS      ENGINE VERSION
qz9y7p1ba3prp23xtuv3uo2dk     ip-172-31-18-206    Ready               Active                                  18.06.1-ce
no97mrg6f7eftbbeu86xg88d9 *   ip-172-31-40-235    Ready               Active              Leader              18.06.1-ce

Upvotes: 2

Views: 2781

Answers (1)

Markus
Markus

Reputation: 3148

you must apply all docker service and docker stack commands on manager nodes. it will deploy automatically the containers on less used nodes. when you want to explicit deploy a container on a specific node, you must tag this node and work with constraints.

Upvotes: 4

Related Questions