Reputation: 6776
I am trying to deploy the application on multiple instances. On master node, I used these bunch of commands:
docker swarm init
docker network create --attachable --driver overlay fabric
docker stack deploy --compose-file docker-compose-org2.yaml fabric
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
:
docker swarm join --token SWMTKN-1-29jg0j594eluoy8g86dniy3opax0jphhe3a4w3hjuvglekzt1b-525ene2t4297pgpxp5h5ayf89 <IP>:2377
docker stack deploy --compose-file docker-compose-org1.yaml fabric
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
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