Docker Swarm| Step by Step | What is Docker Swarm | How to create Docker Swarm
Automation Step by Step
@raghavpalAbout
Simple Basic Beginners Step-by-Step tutorials ❤️ I create videos on Automation, Testing, DevOps, CI and related tools, technologies and platform Raghav is a teacher and founder of AutomationStepByStep.com He was an Automation Architect and has led multiple teams of Automation and DevOps Engineers. For over a decade, Raghav witnessed, worked, and delivered multiple Automation Testing Projects and worked with some awesome people in this industry ► https://automationstepbystep.com/ Some topics covered: - Jenkins - JMeter - Selenium - Appium - Cypress - Playwright - Katalon Studio - API Testing - Postman - Docker - Kubernetes - Other DevOps topics Words from Raghav We often need someone to hold our hand and help us take the first few steps before we learn to walk and run. I am on a mission to spread education and make it available to anyone willing to learn Never Stop Learning Raghav All education here is FREE FOR ALL, FOREVER Share with as many people as you can in your lifetime
Video Description
Free Tutorials - https://automationstepbystep.com/ Hi, I am Raghav & Today we will learn : 1. What is Docker Swarm 2. Why to use it 3. How to create and manage Docker Swarm 4. Create service on docker swarm 5. Scaling services up and down 6. Features/Helpful Tips A swarm is a group of machines that are running Docker and joined into a cluster Docker Swarm is a tool for Container Orchestration Let’s take an example You have 100 containers You need to do - Health check on every container - Ensure all containers are up on every system - Scaling the containers up or down depending on the load - Adding updates/changes to all the containers Orchestration - managing and controlling multiple docker containers as a single service Tools available - Docker Swarm, Kubernetes, Apache Mesos Pre-requisites 1. Docker 1.13 or higher 2. Docker Machine (pre installed for Docker for Windows and Docker for Mac)https://docs.docker.com/machine/install-machine/#installing-machine-directly https://docs.docker.com/get-started/part4/ Step 1 : Create Docker machines (to act as nodes for Docker Swarm) Create one machine as manager and others as workers docker-machine create --driver hyperv manager1 docker-machine create --driver virtualbox manager1 docker-machine:Error with pre-create check: “exit status 126” https://stackoverflow.com/questions/38696164/docker-machineerror-with-pre-create-check-exit-status-126 brew cask install virtualbox; Create one manager machine and other worker machines Step 2 : Check machine created successfully docker-machine ls docker-machine ip manager1 Step 3 : SSH (connect) to docker machine docker-machine ssh manager1 Step 4 : Initialize Docker Swarm docker swarm init --advertise-addr MANAGER_IP docker node ls (this command will work only in swarm manager and not in worker) Step 5 : 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 Step 6 : On manager run standard docker commands docker info check the swarm section no of manager, nodes etc Now check docker swarm command options docker swarm Step 7 : Run containers on Docker Swarm docker service create --replicas 3 -p 80:80 --name serviceName nginx Check the status: docker service ls docker service ps serviceName Check the service running on all nodes Check on the browser by giving ip for all nodes Step 8 : Scale service up and down On manager node docker service scale serviceName=2 Inspecting Nodes (this command can run only on manager node) docker node inspect nodename docker node inspect self docker node inspect worker1 Step 9 : Shutdown node docker node update --availability drain worker1 Step 10 : Update service docker service update --image imagename:version web docker service update --image nginx:1.14.0 serviceName Step 11 : Remove service docker service rm serviceName docker swarm leave : to leave the swarm docker-machine stop machineName : to stop the machine docker-machine rm machineName : to remove the machine REFERENCES: https://docs.docker.com/get-started/part4/#create-a-cluster https://rominirani.com/docker-swarm-tutorial-b67470cf8872 FAQs & Helpful Tips: A swarm is a group of machines that are running Docker and joined into a cluster A cluster is managed by swarm manager The machines in a swarm can be physical or virtual. After joining a swarm, they are referred to as nodes Swarm managers are the only machines in a swarm that can execute your commands, or authorise other machines to join the swarm as workers Workers are just there to provide capacity and do not have the authority to tell any other machine what it can and cannot do you can have a node join as a worker or as a manager. At any point in time, there is only one LEADER and the other manager nodes will be as backup in case the current LEADER opts out #DockerSwarm #WhatIsDockerSwarm #DockerTutorials #DockerTraining #DevOpsTools #DevOpsTraining #DockerCommands #DockerForBeginners #DockerFreeTutorials #DockerforDevOps DOCKER PLAYLIST https://www.youtube.com/playlist?list=PLhW3qG5bs-L99pQsZ74f-LC-tOEsBp2rK YOUTUBE PLAYLIST https://www.youtube.com/channel/UCTt7pyY-o0eltq14glaG5dg/playlists YOUTUBE https://www.youtube.com/automationstepbystep Share your knowledge with everyone and, Never Stop Learning Raghav
Transform Your Space Instantly
AI-recommended products based on this video
![Command Medium Picture Hanging Strips [Removable]: 12 Pairs (White)](https://m.media-amazon.com/images/I/61IChX1hbML._AC_UL960_FMwebp_QL65_.jpg)
Command Medium Picture Hanging Strips [Removable]: 12 Pairs (White)

RoboSeal Rechargeable Mason Jar Vacuum Sealer for Mason Jars Wide and Regular, One Touch Vacuum Sealer for Jars, 10 Lids Included, Digital Battery Indicator, As Seen on TV

2 Pack Outdoor Solar Firework Lights, 240 LED Solar Powered Hanging Lights Outdoor Waterproof Hanging Fairy Garden Lights Landscape Lights(Warm White)

LEGO Icons Bonsai Tree Building Set - Artificial Bonsai Tree Plants for Home Decor, Adults Ages 18+ - Faux, Fake Plants for Table, Desk, Office - Birthday Gift for Men & Women - 10281




















