0% found this document useful (0 votes)
9 views2 pages

Docker Swam

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views2 pages

Docker Swam

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

DockerSwam Document prepared by

VSS Innovative Technologies


Mob : 8792725375 / 7090116480

Docker Swam
Practical procedure step by step:-
1. Create amazon linux system
2. Install Docker
3. Enable password less authentication through SSH
Commands :
ssh-keygen
cat /root/.ssh/id_rsa.pub>>/root/.ssh/authorized_keys
chmod 755 /root/.ssh/authorized_keys
4. Now Server Ready.
Instead of doing same steps in slave systems, We created AMI (image)
5. With the help of Image , create new Ec2 instances
How many slaves you want, create that many Ec2 Instances.
6. Initialize Docker Swarm with below command
docker swarm init --advertise-addr MANAGER_IP

docker node ls

(this command will work only in swarm manager and not in worker)

7. Join workers in the swarm

Get command for joining as worker

In manager node run command


docker swarm join-token worker
This will give command to join swarm as worker

docker swarm join-token manager


This will give command to join swarm as manager

SSH into worker node (machine) and run command to join swarm as worker

In Manager Run command - docker node ls to verify worker is registered and is ready

Do this for all worker machines

8. On manager run standard docker commands


docker node ls

docker info

check the swarm section

no of manager, nodes etc

Now check docker swarm command options

docker swarm

9. Run containers on Docker Swarm

Copy Rights Reserved @ VSS Innovative Technologies


DockerSwam Document prepared by
VSS Innovative Technologies
Mob : 8792725375 / 7090116480
docker service create --replicas 3 -p 80:80 --name vss nginx

Check the status:

docker service ls

docker service ps vss

Check the service running on all nodes

Check on the browser by giving ip for all nodes

10. Scale service up and down

On manager node

docker service scale vss=2

If any Doubts/errors,
Please drop a error screenshots to [email protected]

Reception : 8792725375 / 7090116480

Copy Rights Reserved @ VSS Innovative Technologies

You might also like