18 posts
By default inactive
docker swarm init
To add a worker to this swarm, run the following command:
docker swarm join --token SWMTKN-1-5dwktx410vuftgekfht2av182j0aie65bs2e1smhwehbhogwsq-2uenh58uniqgihh5vtu30lzxc 192.168.65.3:2377
To add a manager to this swarm, run 'docker swarm join-token manager' and follow the instructions
docker node ls
docker node --help
docker service --help
docker service create alpine ping 8.8.8.8
docker service ls
docker service ps <service_name>
docker container ls
scaling
docker service update <service_name> --replicas 3
docker service ps <service_name>
docker container ls
docker service rm <service_name>
docker service ls
docker container ls
Creating 3 node cluster
node1> docker swarm init --advertise-add <public ip>
node2> docker swarm join --token SWMTKN-1-0iq5y2h9ju3cjrkwbfcsr3yps1rugp8hti4kn0rjo0lrzul3io-4xnbeaq1h2adx0t9m17xcheuv 192.168.0.28:2377
node3> docker swarm join --token SWMTKN-1-0iq5y2h9ju3cjrkwbfcsr3yps1rugp8hti4kn0rjo0lrzul3io-4xnbeaq1h2adx0t9m17xcheuv 192.168.0.28:2377
To make another node as manager
node1> docker node update --role manager node2
node2> docker swarm join-token manager
node2> docker swarm join --token SWMTKN-1-0iq5y2h9ju3cjrkwbfcsr3yps1rugp8hti4kn0rjo0lrzul3io-7qc2wwr5tyux5sbke0jvinmtf 192.168.0.28:2377
docker service create --replicas 3 alpine ping 8.8.8.8
docker service ps <service_name>
Please log in to leave a comment.
18 posts