sir thanks for your courses i have a question : how can join a node from another location such as my manager be in one country and worker in another country? is it possible?
I have gone thru all of your docker videos and also the GitLab ones. Thanks you so much for putting together such an amazing content, these are very well explained along with simple to understand follow along session. I started as the one who doesn't know anything about GitLab or Docker but now after completion I feel very comfortable with these technologies and gave confidence to pursue further in detail. Appreciate all the work you have put in.
Hello Raghav Da, This tutorial is really great for a beginner like me but since I am working on docker latest version I can't find docker-machine in my system installed neither was I successful to install it in my system separately, if you can please guide. Also just checking if there is any recent tutorial on docker swarm? Thanks a ton Binita
1. Docker Machine: - Docker Machine has been removed from later versions of Docker Desktop. However, you can still install it separately if needed. - For macOS, you can use Homebrew to install Docker Machine with the following command: ``` brew install docker-machine ``` - Once installed, you can use Docker Machine commands as usual. Keep in mind that Docker Machine is now merged into the `docker` command. For example: - Instead of `docker-machine init`, use `docker swarm init` - Instead of `docker-machine join`, use `docker swarm join` - For more commands, use `docker swarm --help` 2. Docker Swarm Tutorial: - To get started with Docker Swarm, follow the official [Docker Swarm tutorial] docs.docker.com/engine/swarm/swarm-tutorial/ - This tutorial covers initializing a cluster of Docker Engines in swarm mode, adding nodes to the swarm, deploying application services, and managing the swarm. - If you're new to Docker, it's a great way to learn the basics and explore container orchestration -
Good tutorial! I came here knowing nothing about Docker Swarm and now I feel comfortable to get started playing with it. I have 2 questions/observations: 1) In the case of nginx where 2 nodes were running 14.0.1 and 1 node was running “latest”, will the swarm still operate properly with nodes running different versions? 2) while we have the advantage of redundancy by having multiple nodes, we still have a single point of failure if the physical host fails. Can we create a swarm that spans multiple physical hosts? If so, how?
when you join the swarm as a worker by specifying the manager ip, the port number that's specified there in the ip is 2376..so thats apparently docker daemon port which may result in an error..this was written on the docker docs page itself..so the docs suggest that we specify 2377 when we do swarm init and then join as worker node with the ip that we will see there..it works like a charm
Wow. You are king of breaking down complex topics. This was something I've been wanting to do on my host machine for testing container orchestration. I can't wait to try this.
Thanks. Need quick clarifications, 1) Is it making use of locally available images, when you run 'services'? 2) Can we use 'docker-compose.yml' file for multi image container? If so how to refer it? 2) General Q: If you use 'virtualbox' for node creation, then we have to pay for overhead of hypervisor (this is benefit of not having hypervisor on docker) what typically we compare container against VM right?
Hi, 1) when you run, it checks if the image is available locally else pull it from repo 2) yes, we can do it. Refer - docs.docker.com/compose/reference/overview/ 3) Some info on this you can find here - ruclips.net/video/0e-KiGJIiDc/видео.html
Hi Raghav! your tutorial is best for beginners just like me. I am very confused with the docker swarm. I have a doubt. Can we manage multiple servers(multiple systems) with the swarm manager?
You are angel brother, you explain stuff in very very easy words, which blessing for people like me, i was not understanding what is docker, but your videos gave me know a very solid base, Bundle of thanks
Is there a way that we can have live session, you can teach me Docker in few session and you can charge me whatever is reasonable, i know there are paid tutorial but i would like to have live session or class, Muzzamiljaved1@gmail.com +19292537393 Thanks
Hi Muzzamil, Live session will be difficult for me. Engaged with multiple events. You can learn from here and can send me messages - automationstepbystep.com/online-courses/
Hi sir,I have few doubts * In Docker Swarm ---->Creating a service is nothing but creating a container ? * In Docker Swarm ------->Only manual scaling will be there ? * Sir, I have a little bit idea in kubernetes that , If we want to enable a service like Load balancing in kubernetes--------> We create a service . So, In Docker Swarm-------->Is Load balancing works ? If yes, How it works? * Is there any Manifest file(DECLARATIVE WAY) in docker swarm like kubernetes ?
Hi Hari, Here are the answers to your Docker Swarm related questions: Creating a service in Docker Swarm is not the same as creating a container. A Docker service is a logical construct that defines how one or more containers should be deployed and managed on a swarm cluster. When you create a service, Swarm orchestrates the creation of containers based on the service definition. In Docker Swarm, you can scale a service both manually and automatically. With manual scaling, you specify the number of replicas of a service to create, while with automatic scaling, you set up scaling policies based on metrics such as CPU usage or network traffic. Yes, Docker Swarm supports load balancing. When you create a service, you can specify the type of load balancing to use. Swarm supports several load balancing modes, including round-robin, source IP, and least connections. Swarm uses IPVS (IP Virtual Server) to perform load balancing, which is a kernel module that provides advanced load balancing features. Yes, Docker Swarm also supports declarative configuration using a manifest file similar to Kubernetes. The Docker Swarm manifest file is called a Compose file and uses the YAML syntax. A Compose file defines the services, networks, and volumes that make up your application and how they should be deployed and managed on a swarm cluster
@@RaghavPal Thank you Sir❤ for giving your valuable information and time. It helps me a lot. Sir, i have one last question. So, In real time which orchestration tool we are going to use(Docker Swarm or Kubernetes).? Are we going to use both of them?
Hari, n real-time, the choice between Docker Swarm and Kubernetes as the orchestration tool would depend on various factors such as the complexity of the project, the scalability needs, the level of automation required, the deployment environment, the level of community support, and the expertise of the team. Docker Swarm is a simple orchestration tool that is easy to set up and manage. It is best suited for small-scale projects with straightforward deployment requirements. Docker Swarm provides basic features like service discovery, load balancing, and automatic failover. Kubernetes, on the other hand, is a more complex and feature-rich orchestration tool that is suitable for large-scale, complex projects with high scalability needs. Kubernetes offers advanced features like auto-scaling, rolling updates, service mesh, and can be used in hybrid and multi-cloud environments. Both Docker Swarm and Kubernetes have their pros and cons, and the choice between them should be made based on the specific requirements of the project.
It is very clear to understand the docker swarm, Could you please explain the spring boot app to generate the docker image and deploy docker image in docker container and using docker swarm how to scale up and scale down the services dynamically please make a single video for above all
Good stuff raghav. Clean explanation. I did tried on aws ec2 ubuntu instance i got this error "This computer doesn't have VT-X/AMD-v enabled. Enabling it in the BIOS is mandatory". Can you help me
Hi, did you watch the installation videos. I believe I covered this there. I think I got this on the windows session. Can also check here github.com/docker/machine/issues/4271
Hi Raghav, Very useful video. Thanks for this How to automate the scale up and down the services? If the services exceed for eg. CPU > 90% on worker1 and Memory exceeding threshold values on worker2 - then scale up is needed, can that be done in any manner? and scale down when the services are under the threshold limits?
Super tutorial. I have a question. You showed that nginx was running on the three IPs of the docker swarm. To show it, you opened chrome and put the ip in a chrome tab. Then, you created a fourth instance of nginx (scaling up). How can I access that instance from chrome? port 80 should be already occupied, isn'it?
Hi Michele, This is due to INGRESS AND ROUND ROBIN LOAD BALANCING This explains it beautifully stackoverflow.com/questions/46407531/docker-swarm-scaling-behaviour-on-port-mapping forums.docker.com/t/how-does-docker-swarm-map-ports-twice/41623 blog.scottlogic.com/2016/08/30/docker-1-12-swarm-mode-round-robin.html
Hello Raghav. Question 1: =========================== What if i have 1 master and 2 worker And i scale the nginx service to =10 Now multiple containers are running on each node of the swarm. If i open my browser and connect to IP of Worker1 which has 3 containers running, what will happen? are the 3 containers in the worker node automatically load balanced?? Questions 2: What can i do if i want to load balance all 3 swarm nodes..so there is 1 IP for connecting to the nginx website on any of the containers or any of the nodes?
Hi For this will need to understand docker port mapping and scaling. Here are some references docs.docker.com/engine/swarm/key-concepts/ stackoverflow.com/questions/38537849/docker-swarm-mode-multiple-services-same-port github.com/docker/swarm/issues/2499 stackoverflow.com/questions/38853461/docker-swarm-map-ports-and-scaling
Hi Saket, you should have hands-on experience with the applications. If you can get good practical experience and have knowledge to handle diff scenarios, that should be enough for job preparation.
Hi Raghav, i have gone through all your docker videos. It was awesome videos. Now i am familiar with docker now. could you please make videos on docker portainer. Thanks in advance
Hi Pranjal, You need to provide an IP address of your host, or a network interface which Docker will use to lookup your IP address, and a port number which defaults to 2377 check this boxboat.com/2016/08/17/whats-docker-swarm-advertise-addr/
@@RaghavPal I have run below command, it works for me to create manager node docker swarm init --adverise-addr 127.0.0.1 but now i'm unable to create worker nodes. Plz help me Raghav to do so Note: Tried testing on vagrant virtual box, ubuntu wsl but not worked for me
Thank you for this able to understand this completely. great to see you have done this magic in 2018. looks like docker-machine is in deprecated mode now. But i think concept would remain same. Thank you for covering this topic
Excellent video (again). I am left with a similar question to one I left on another video. What do we do about backing stores? A service is only as good as the stored state and data associated with the service. Would we have to make special containers that are capable of being set up in a swarm? By that I mean: do the containers need to run applications which use external storage, do those applications need to take care in accessing that storage, and/or does the storage interface need to provide atomic access? I hope my question is clear. Thanks.
Hi, There are ways to handle this, we have option of external storage and there are platforms like Kubernetes that can manage all this. I will yet explore more and update this information
Hi bud, I have a big question after watching your Docker videos. Maybe I should have noticed it. I want to execute my UI and API tests built in Selenium and Postman using multiple images/containers. Is there a Step by Step video on this? Setting up the docker file, selecting the files, etc? If yes, did I miss it? Any advice for me. thx
Hi Mike as of now I do not have anything on this. You can check some online tutorials. Can start with following steps: Install Docker on your machine. Create a Dockerfile for each of your tests (UI and API). The Dockerfile contains instructions on how to build your image, including installing dependencies and copying your test files to the image. Build your Docker images using the docker build command. This will create a container with your test files and dependencies installed. Run your tests using the docker run command. You can pass environment variables to your containers to specify which tests to run or which test environment to use.
Thanks, When you create a node using 'virtualbox' as parameter, 1) Are you creating a VM? 2) Can we use a another physical machine as node? 3) Can I use another datacentre IP address? Thanks
Hi Raghav! thank for your video and help us. I have a doubt: 1- I can't install docker-machine, because now isn't more available, or not? 2 - I can not start the command "docker-machine create --driver virtualbox manager1", why? is for not available as before? Thank you.
Hi Camila Docker Machine is still available and can be installed from the Docker website: docs.docker.com/machine/install-machine/ The docker-machine create command is used to create a new Docker host using a specified driver. The virtualbox driver is used to create a Docker host running in a VirtualBox virtual machine. If you're unable to start the command, it could be due to a few reasons: VirtualBox is not installed on your system. You need to install VirtualBox before you can use the virtualbox driver. The VirtualBox driver is not installed in Docker Machine. You can install the driver using the command docker-machine create -d virtualbox. There may be an issue with your Docker Machine installation or configuration. You can try reinstalling Docker Machine or checking your configuration settings. I recommend checking if VirtualBox is installed and if the VirtualBox driver is installed in Docker Machine before attempting to create a new Docker host.
A docker compose file with scale commands will also do the same job? what is the difference between compose and swarm? i understand that swarm is used for Orchestration
Yes Krissh, found some useful information on this here : www.quora.com/Whats-the-difference-between-Docker-Swarm-Docker-Compose-and-Docker-Networks stackoverflow.com/questions/42545431/when-to-use-docker-compose-and-when-to-use-docker-swarm
Hello Ragav, Docker series is worth to watch and it’s perfectly step by step educative. Can you have “OpenStack” series like Docker which get complete OpenStack step-by-step ?
This is what i'm thinking and it could be wrong all together. So when you scaled up to 4 it created another service on the manager. Does this mean that the manager node exposed on 1 IP address is now running two instances of web1 on it and helping the load from the requests coming into that node? I'm assuming that more node resources would be needed to keep running more services when scaling up correct? Just trying to understand is all. Thank you very much.
So when you scale up, it checks the load on each node and then does calculations as to on which node the next service should go. You can find a lot of online examples and more info on that
Hi Raghav, great video. I saw your other video regarding volume sharing. What is the easiest way to share volume from docker swarm to your local folder? I want to be able to run my test on the docker swarm, download some files and be able to access these files through a local folder. Thank you for your help.
@@RaghavPal Hi Raghav, do you have any tutorial on sharing volumes from a docker swarm to a local folder? Do you just map it to the manager node or do you need to do it for every worker nodes? I appreciate your help. Thanks.
Excellent job man, please keep it up but question please , when u scaled to 4 instances with only 3 node .. this means 1 node run the server on port 80 twice .. and I think it's not applicable correct ?? so please clarify Thanks
Hi Mahmoud, I will check more on this, here are some links with useful information stackoverflow.com/questions/38537849/docker-swarm-mode-multiple-services-same-port github.com/docker/swarm/issues/2499 stackoverflow.com/questions/38853461/docker-swarm-map-ports-and-scaling
@@RaghavPal When you created a node or machine, we never mentioned any OS type. When you said 'docker-machine ssh worker1', you got a console prompt. What is the OS installed on it. Is it ubuntu, alpine, sandbox? Or the nodes are created of host type? Say, my workstation is of RHEL, when I run 'docker-machine create -driver virtualbox node', Does it create a node of OS RHEL?
Hi Raghav, it's a nice video. but here I have a doubt. when i run docker-machine -v it gives me below statement Command 'docker-machine' not found, but can be installed with: snap install docker. I have already installed docker on AWS ubutnu server. Please could i know what is the difference between docker-machine and docker thanks
Hi Samresh, Not sure if I have shown in the same video, Will have to watch the video again. You can see all videos in this playlist ruclips.net/p/PLhW3qG5bs-L99pQsZ74f-LC-tOEsBp2rK
Hi Raghav, Thanks for the uploading this Video. I have a quick question we have 3 containers in one virtual machine. Openam, Opendj, and MySQL. we created this system for single sign-on.Mysql and opendj is a database. Openam is a web service. Will this method work in our system? How many nodes, I need to create for each container?
Hi Raghav, you are explaining every module of docker on your Mac OS, mostly we use redhat or windows OS and very less usage of Mac, can you also explain how to install it on LINUX OS as well, thanks for your videos
When multiple containers are running on the same VM with same port mapping, why is there no conflict in running the containers? When we access nginx instance on any VM having multiple containers of nginx running, which instance of nginx does the browser point to?
Hi Sachin, very good question. This is due to INGRESS AND ROUND ROBIN LOAD BALANCING This explains it beautifully stackoverflow.com/questions/46407531/docker-swarm-scaling-behaviour-on-port-mapping forums.docker.com/t/how-does-docker-swarm-map-ports-twice/41623 blog.scottlogic.com/2016/08/30/docker-1-12-swarm-mode-round-robin.html
Hi Raghav, If i have 50 micro services, than i have to create 50 different managers and there workers or i can run all 50 services in single manager with 2 defined workers ?
Hi Gaurav, Depends on how you need to scale up / down / start or stop services. You should be able to do with less managers. Does not need 50 managers for 50 microservices
I have a question. When we pull an image suppose of mysql, then do we need to create a service for it as well in docker-compose.yml file? And if we have another service running that is using python in it, then do we need to connect that service with the database service in docker-compose file by connecting them via network if we are trying to use database connection in the python file used in another service that is running?
Hi Vaidehi, this will depend on your needs and based on your needs you will put the information in dockerfile, I will try to show an example soon, Can watch the existing dockerfile videos
Hi Raghav. Thank you for another awesome tutorial. I am getting confused between docker compose and docker swarm. Unable to differentiate between them. Both of them provides scaling option.
Also, @28:04 updating the version randomly started the service on worker2 and shut it down on worker1 whereas before there was nothing working on worker2.
Hi Shivam, hope you have seen both the videos. Docker Compose is used to setup application with different components. So you can create multiple containers and connect them for the application to work. Docker Swarm is an orchestration tool Here is good information - www.quora.com/Whats-the-difference-between-Docker-Swarm-Docker-Compose-and-Docker-Networks
Thanks for this. I managed to set up 3 managers and 2 workers and point my domain to all 5 ip addresses of the 5 nodes. I then ran a test using nginx service and all works fine, however I noticed that sometimes it takes a while for the nginx page to load espscially if i kill one node, it take over 20 seconds for the nginx page to show When I disable the swarm and remove all the nodes and run the service only in one node all works fine but as soon as I set up the swarm then issue start again. All the nodes are in the same Digitalocean datacenter. your advice will be highly appreciated.
@@RaghavPal Hi Raghav, Thanks for the reply. The problem was the ports, every thing worked perfectly as soon as I opened Port 7946 TCP/UDP for container network discovery and Port 4789 UDP for the container ingress network. I hope this info will help someone one day.
I'm new here. Could you please tell me why we would want multi instances (containers) of 1 service on the same machine? for example in this video, what's the point of having 2 nginx container on worker1 machine? And is the port of the 2nd instance also :80? Also, as I understand, all the nodes in a Docker swarm are inside 1 physical computer. Docker swarm is not used to manage nodes remotely via internet (for example, if I have some EC2 instances and each of them have many nodes, I cannot setup to control them from my personal computer). Is that correct?
Hi Lê Thái, We have multiple containers that should work together to solve a business problem. In real world managing these multiple containers separately will be a difficult task. Wish docker swarm, we can do all this management of containers, scaling services, orchestration etc easily You will get more info here developer.ibm.com/dwblog/2017/what-is-docker-swarm-cluster-engines/
Free online courses - automationstepbystep.com/online-courses/
I created a Windows Docker image using Dockerfile, how do I use that image, It's locally available on my machine.
sir thanks for your courses i have a question : how can join a node from another location such as my manager be in one country and worker in another country?
is it possible?
This is by far the best docker tutorial series on RUclips!
So happy & humbled to see your message Keshav
This is hands down the most simplest and straight-forward break down of docker swarm. Thanks a lot for this amazing video
So happy and humbled. Thanks Aleena
6 years tutorial but still relevant. You have earned a subscriber even if i dont come back. Thank you.
Thanks a lot Osei
I have gone thru all of your docker videos and also the GitLab ones.
Thanks you so much for putting together such an amazing content, these are very well explained along with simple to understand follow along session. I started as the one who doesn't know anything about GitLab or Docker but now after completion I feel very comfortable with these technologies and gave confidence to pursue further in detail. Appreciate all the work you have put in.
You're very welcome Ravi. Can check all here - automationstepbystep.com/
Can't help thinking how could someone dislike a free tutorial as good as this. Thank you very much Raghav!
Most welcome Vivek
The best dockers tutorials I've ever see, thank you.
Thanks and most welcome..
Best Docker Swarm video Across RUclips...... Thanks a lot....... Love from Bihar❤❤
Most welcome and humbled
Amazing tutorials!! Appreciate you, Raghav! Thanks again!
Most welcome Pavon
Hello Raghav Da, This tutorial is really great for a beginner like me but since I am working on docker latest version I can't find docker-machine in my system installed neither was I successful to install it in my system separately, if you can please guide. Also just checking if there is any recent tutorial on docker swarm?
Thanks a ton
Binita
1. Docker Machine:
- Docker Machine has been removed from later versions of Docker Desktop. However, you can still install it separately if needed.
- For macOS, you can use Homebrew to install Docker Machine with the following command:
```
brew install docker-machine
```
- Once installed, you can use Docker Machine commands as usual. Keep in mind that Docker Machine is now merged into the `docker` command. For example:
- Instead of `docker-machine init`, use `docker swarm init`
- Instead of `docker-machine join`, use `docker swarm join`
- For more commands, use `docker swarm --help`
2. Docker Swarm Tutorial:
- To get started with Docker Swarm, follow the official [Docker Swarm tutorial] docs.docker.com/engine/swarm/swarm-tutorial/
- This tutorial covers initializing a cluster of Docker Engines in swarm mode, adding nodes to the swarm, deploying application services, and managing the swarm.
- If you're new to Docker, it's a great way to learn the basics and explore container orchestration
-
You are brilliant man!! Love from United States!
Thanks a lot Aman, Honored and humbled by your message
Good tutorial! I came here knowing nothing about Docker Swarm and now I feel comfortable to get started playing with it. I have 2 questions/observations: 1) In the case of nginx where 2 nodes were running 14.0.1 and 1 node was running “latest”, will the swarm still operate properly with nodes running different versions? 2) while we have the advantage of redundancy by having multiple nodes, we still have a single point of failure if the physical host fails. Can we create a swarm that spans multiple physical hosts? If so, how?
Hi Donny, we can, I will try to do a session on this
Not just Swarm, now I also know what docker-machine is for. Thank you.
So happy to know this Abbas. Best wishes
Really my first video to complete without forwarding, because the way indexing the topic is good...
So happy to know Manikanta
Oh God! This is the best docker tutorial I've watched so far. Thanks for making it all so meaningful
Most welcome Abdul
Hi your way of explanation is too good sir... I have a request sir can you please start kubernetes series.
Hi Obbineni, I have some videos here - automationstepbystep.com/
when you join the swarm as a worker by specifying the manager ip, the port number that's specified there in the ip is 2376..so thats apparently docker daemon port which may result in an error..this was written on the docker docs page itself..so the docs suggest that we specify 2377 when we do swarm init and then join as worker node with the ip that we will see there..it works like a charm
Hi thanks for adding this
Wow. You are king of breaking down complex topics. This was something I've been wanting to do on my host machine for testing container orchestration. I can't wait to try this.
Happy to know it was useful Derrick
yes dude it's very useful, indian guys always amaze me.
thankyou very much
Happy to help
@@RaghavPal hey dude, how to deploy with stack from local build?
I will plan a session, can take online help meanwhile
Works Flawless, One of the best tutorial on Docker Swarm.
So happy to know this
thanx, Raghav.
you are fantastic and more organized.
Thanks
Thanks for this video - just being curious, in 2022 is valuable learn "Docker Swarm" or is better go directly to "kubernetes"? Thank You
Both! I will suggest to watch this to get information and then you will be in a better position to compare Docker Swarm with Kubernetes
You are awesome Raghav. I love the way you explain things from scratch. Thanks much.
You're welcome Parul
Thank u raghav sir...ure explaination was awesome
Great to know this Pradeep
Well Organized and Simplified Understanding . Great going Raghav !!!
Thanks Sudhanshu
Successfully completed dockers ❤️ very simple ❤️ thanks for this Raghav ❤️
You're welcome Md. Asaruddin
Thank you Raghav.. Your Tutorials are very easy to understand and as simple as your explanation.. Great job..
You're welcome
Thanks. Need quick clarifications,
1) Is it making use of locally available images, when you run 'services'?
2) Can we use 'docker-compose.yml' file for multi image container? If so how to refer it?
2) General Q: If you use 'virtualbox' for node creation, then we have to pay for overhead of hypervisor (this is benefit of not having hypervisor on docker) what typically we compare container against VM right?
Hi,
1) when you run, it checks if the image is available locally else pull it from repo
2) yes, we can do it. Refer - docs.docker.com/compose/reference/overview/
3) Some info on this you can find here - ruclips.net/video/0e-KiGJIiDc/видео.html
Amazing tutorial for docker swarm, terimakasih pak
Most welcome
Hi Raghav! your tutorial is best for beginners just like me. I am very confused with the docker swarm.
I have a doubt. Can we manage multiple servers(multiple systems) with the swarm manager?
Yes, for what is in scope under docker
You are angel brother, you explain stuff in very very easy words, which blessing for people like me, i was not understanding what is docker, but your videos gave me know a very solid base,
Bundle of thanks
You're welcome Muzzamil. Thanks for the wishes. Humbled
Is there a way that we can have live session, you can teach me Docker in few session and you can charge me whatever is reasonable, i know there are paid tutorial but i would like to have live session or class,
Muzzamiljaved1@gmail.com
+19292537393
Thanks
Hi Muzzamil, Live session will be difficult for me. Engaged with multiple events. You can learn from here and can send me messages - automationstepbystep.com/online-courses/
What a wonderful Teacher you are!
Thank you Hareesh. Humbled :)
Thanks Raghav - very clear and well organised tutorial. Thank you for putting this together.
You're welcome
Nice video. What a clear and clean explanation. Thank you..! For the video..
Most welcome
it was super useful...i love love your teaching styles..thanks alot
Most welcome Roselyne
Hi sir,I have few doubts
* In Docker Swarm ---->Creating a service is nothing but creating a container ?
* In Docker Swarm ------->Only manual scaling will be there ?
* Sir, I have a little bit idea in kubernetes that , If we want to enable a service like Load balancing in kubernetes--------> We create a service .
So, In Docker Swarm-------->Is Load balancing works ? If yes, How it works?
* Is there any Manifest file(DECLARATIVE WAY) in docker swarm like kubernetes ?
Hi Hari,
Here are the answers to your Docker Swarm related questions:
Creating a service in Docker Swarm is not the same as creating a container. A Docker service is a logical construct that defines how one or more containers should be deployed and managed on a swarm cluster. When you create a service, Swarm orchestrates the creation of containers based on the service definition.
In Docker Swarm, you can scale a service both manually and automatically. With manual scaling, you specify the number of replicas of a service to create, while with automatic scaling, you set up scaling policies based on metrics such as CPU usage or network traffic.
Yes, Docker Swarm supports load balancing. When you create a service, you can specify the type of load balancing to use. Swarm supports several load balancing modes, including round-robin, source IP, and least connections. Swarm uses IPVS (IP Virtual Server) to perform load balancing, which is a kernel module that provides advanced load balancing features.
Yes, Docker Swarm also supports declarative configuration using a manifest file similar to Kubernetes. The Docker Swarm manifest file is called a Compose file and uses the YAML syntax. A Compose file defines the services, networks, and volumes that make up your application and how they should be deployed and managed on a swarm cluster
@@RaghavPal Thank you Sir❤ for giving your valuable information and time.
It helps me a lot.
Sir, i have one last question.
So, In real time which orchestration tool we are going to use(Docker Swarm or Kubernetes).? Are we going to use both of them?
Hari,
n real-time, the choice between Docker Swarm and Kubernetes as the orchestration tool would depend on various factors such as the complexity of the project, the scalability needs, the level of automation required, the deployment environment, the level of community support, and the expertise of the team.
Docker Swarm is a simple orchestration tool that is easy to set up and manage. It is best suited for small-scale projects with straightforward deployment requirements. Docker Swarm provides basic features like service discovery, load balancing, and automatic failover.
Kubernetes, on the other hand, is a more complex and feature-rich orchestration tool that is suitable for large-scale, complex projects with high scalability needs. Kubernetes offers advanced features like auto-scaling, rolling updates, service mesh, and can be used in hybrid and multi-cloud environments.
Both Docker Swarm and Kubernetes have their pros and cons, and the choice between them should be made based on the specific requirements of the project.
@@RaghavPal Thank you Sir❤for your valuable information and time.
It helps me a lot.
And Thankyou so much Sir for this super simplified course on Docker... You are an awesome teacher...Thankyou so much from the bottom of my heart !!!
You are most welcome Susmit
It is very clear to understand the docker swarm, Could you please explain the spring boot app to generate the docker image and deploy docker image in docker container and using docker swarm how to scale up and scale down the services dynamically please make a single video for above all
Hi Sai, I will try to do a session with Sprint Boot app. For now, pls try to find an example online
Good stuff raghav. Clean explanation. I did tried on aws ec2 ubuntu instance i got this error "This computer doesn't have VT-X/AMD-v enabled. Enabling it in the BIOS is mandatory". Can you help me
Hi, did you watch the installation videos. I believe I covered this there. I think I got this on the windows session. Can also check here
github.com/docker/machine/issues/4271
Hi Raghav
Your video are so helpful for beginner, thank you for posting the videos
Most welcome Vijay
Hi Raghav,
Very useful video. Thanks for this
How to automate the scale up and down the services? If the services exceed for eg. CPU > 90% on worker1 and Memory exceeding threshold values on worker2 - then scale up is needed, can that be done in any manner? and scale down when the services are under the threshold limits?
Hi Krissh, I believe for this we can use some server monitoring tools
Super tutorial. I have a question. You showed that nginx was running on the three IPs of the docker swarm. To show it, you opened chrome and put the ip in a chrome tab. Then, you created a fourth instance of nginx (scaling up). How can I access that instance from chrome? port 80 should be already occupied, isn'it?
Hi Michele, This is due to INGRESS AND ROUND ROBIN LOAD BALANCING
This explains it beautifully
stackoverflow.com/questions/46407531/docker-swarm-scaling-behaviour-on-port-mapping
forums.docker.com/t/how-does-docker-swarm-map-ports-twice/41623
blog.scottlogic.com/2016/08/30/docker-1-12-swarm-mode-round-robin.html
Hello Raghav.
Question 1:
===========================
What if i have 1 master and 2 worker
And i scale the nginx service to =10
Now multiple containers are running on each node of the swarm.
If i open my browser and connect to IP of Worker1 which has 3 containers running,
what will happen? are the 3 containers in the worker node automatically load balanced??
Questions 2:
What can i do if i want to load balance all 3 swarm nodes..so there is 1 IP for connecting to the nginx website on any of the containers or any of the nodes?
Hi
For this will need to understand docker port mapping and scaling. Here are some references
docs.docker.com/engine/swarm/key-concepts/
stackoverflow.com/questions/38537849/docker-swarm-mode-multiple-services-same-port
github.com/docker/swarm/issues/2499
stackoverflow.com/questions/38853461/docker-swarm-map-ports-and-scaling
Ultimate series. Highly appreciate your efforts.
Thanks a ton Himanshu
Thanks, simple and easy to understand.
Glad it was helpful!
Hi Raghav..Could you please suggest for docker and kubernetes for job preparation? How to prepare?
Hi Saket, you should have hands-on experience with the applications. If you can get good practical experience and have knowledge to handle diff scenarios, that should be enough for job preparation.
This best demo of docker swarm
So happy and humbled to see this Mayur
Hi Raghav, i have gone through all your docker videos. It was awesome videos. Now i am familiar with docker now. could you please make videos on docker portainer. Thanks in advance
Sure Ramesh, will plan
Hi Raghav,
Big fan of your tutorials...
Just have a small doubt after watching this video which ip to be put with --advertise-addrs
Hi Pranjal, You need to provide an IP address of your host, or a network interface which Docker will use to lookup your IP address, and a port number which defaults to 2377
check this boxboat.com/2016/08/17/whats-docker-swarm-advertise-addr/
@@RaghavPal I have run below command, it works for me to create manager node
docker swarm init --adverise-addr 127.0.0.1
but now i'm unable to create worker nodes.
Plz help me Raghav to do so
Note: Tried testing on vagrant virtual box, ubuntu wsl but not worked for me
Hi Pranjal, do you have any logs, Also check other uses comments
thanks a lot Raghav. your tutorials are well explanatory with good examples.
You're welcome Harsh
Thank you for this able to understand this completely. great to see you have done this magic in 2018.
looks like docker-machine is in deprecated mode now. But i think concept would remain same. Thank you for covering this topic
Most welcome, I will try creating new videos
Excellent video (again). I am left with a similar question to one I left on another video. What do we do about backing stores? A service is only as good as the stored state and data associated with the service. Would we have to make special containers that are capable of being set up in a swarm? By that I mean: do the containers need to run applications which use external storage, do those applications need to take care in accessing that storage, and/or does the storage interface need to provide atomic access?
I hope my question is clear.
Thanks.
Hi, There are ways to handle this, we have option of external storage and there are platforms like Kubernetes that can manage all this. I will yet explore more and update this information
Hi bud, I have a big question after watching your Docker videos. Maybe I should have noticed it. I want to execute my UI and API tests built in Selenium and Postman using multiple images/containers. Is there a Step by Step video on this? Setting up the docker file, selecting the files, etc? If yes, did I miss it? Any advice for me. thx
Hi Mike
as of now I do not have anything on this. You can check some online tutorials. Can start with following steps:
Install Docker on your machine.
Create a Dockerfile for each of your tests (UI and API). The Dockerfile contains instructions on how to build your image, including installing dependencies and copying your test files to the image.
Build your Docker images using the docker build command. This will create a container with your test files and dependencies installed.
Run your tests using the docker run command. You can pass environment variables to your containers to specify which tests to run or which test environment to use.
Thanks, When you create a node using 'virtualbox' as parameter,
1) Are you creating a VM?
2) Can we use a another physical machine as node?
3) Can I use another datacentre IP address?
Thanks
Hi, yes you can use another physical machine as long as they can connect and talk over a network
@@RaghavPal Thanks for the clarification. Can we use any other Linux OS instead virtualbox to create nodes.
A nice tutorial which shows all the basics needed for scaling Thanks
Thanks for the message Mojtaba
Very useful and easy to understand tutorial.
Glad to hear that Manish
Hi Raghav! thank for your video and help us. I have a doubt: 1- I can't install docker-machine, because now isn't more available, or not? 2 - I can not start the command "docker-machine create --driver virtualbox manager1", why? is for not available as before? Thank you.
Hi Camila
Docker Machine is still available and can be installed from the Docker website: docs.docker.com/machine/install-machine/
The docker-machine create command is used to create a new Docker host using a specified driver. The virtualbox driver is used to create a Docker host running in a VirtualBox virtual machine. If you're unable to start the command, it could be due to a few reasons:
VirtualBox is not installed on your system. You need to install VirtualBox before you can use the virtualbox driver.
The VirtualBox driver is not installed in Docker Machine. You can install the driver using the command docker-machine create -d virtualbox.
There may be an issue with your Docker Machine installation or configuration. You can try reinstalling Docker Machine or checking your configuration settings.
I recommend checking if VirtualBox is installed and if the VirtualBox driver is installed in Docker Machine before attempting to create a new Docker host.
I am following your videos and need to say your videos are simple to understand. Great work bro . Keep it up 👍
Happy to know it helps Prakash
Great job with this Raghav
Thanks Mark
A docker compose file with scale commands will also do the same job? what is the difference between compose and swarm?
i understand that swarm is used for Orchestration
Yes Krissh, found some useful information on this here :
www.quora.com/Whats-the-difference-between-Docker-Swarm-Docker-Compose-and-Docker-Networks
stackoverflow.com/questions/42545431/when-to-use-docker-compose-and-when-to-use-docker-swarm
Hello Ragav,
Docker series is worth to watch and it’s perfectly step by step educative.
Can you have “OpenStack” series like Docker which get complete OpenStack step-by-step ?
Hi Krunal, Sure I will do it
Very well Sir ....Am totally new to docker ..it is very helpful ..thank you so much
You're welcome Prashant
This is what i'm thinking and it could be wrong all together. So when you scaled up to 4 it created another service on the manager. Does this mean that the manager node exposed on 1 IP address is now running two instances of web1 on it and helping the load from the requests coming into that node? I'm assuming that more node resources would be needed to keep running more services when scaling up correct? Just trying to understand is all. Thank you very much.
So when you scale up, it checks the load on each node and then does calculations as to on which node the next service should go. You can find a lot of online examples and more info on that
all steps nicely explained .. really a very useful tutorial ...
Glad it was helpful Subhankar
Hi Raghav, great video. I saw your other video regarding volume sharing. What is the easiest way to share volume from docker swarm to your local folder? I want to be able to run my test on the docker swarm, download some files and be able to access these files through a local folder. Thank you for your help.
You can use volumes in this case Jason
@@RaghavPal Hi Raghav, do you have any tutorial on sharing volumes from a docker swarm to a local folder? Do you just map it to the manager node or do you need to do it for every worker nodes? I appreciate your help. Thanks.
Hi Jason, I may have shown this on the Jenkins on Docker session, but for more details, you will need to check online examples
Excellent job man, please keep it up
but question please , when u scaled to 4 instances with only 3 node .. this means 1 node run the server on port 80 twice .. and I think it's not applicable correct ??
so please clarify
Thanks
Hi Mahmoud, I will check more on this, here are some links with useful information
stackoverflow.com/questions/38537849/docker-swarm-mode-multiple-services-same-port
github.com/docker/swarm/issues/2499
stackoverflow.com/questions/38853461/docker-swarm-map-ports-and-scaling
You make the Docker Swarm topic look so simple. Nicely explained.
Happy to know this Lom
Superb Raghav. thank you.
Most welcome
A must watch video...thanks for posting it...
So happy to read this Mohit. All the best
Awesome video bro! Very useful and informative for beginner. Thanks for this work.
Glad it helped Abijith
bro as a fresher to job is this docker playlist 15 videos enough or should learn deep
This will be good to get you started on any docker project, after that you will need to learn more as per the project needs
once you docker-machine ssh , you got prompt. Is it a VM of OS type of host type? or some other OS?
Hi, did not understand your query. Pls provide some details
@@RaghavPal When you created a node or machine, we never mentioned any OS type. When you said 'docker-machine ssh worker1', you got a console prompt. What is the OS installed on it. Is it ubuntu, alpine, sandbox?
Or the nodes are created of host type? Say, my workstation is of RHEL, when I run 'docker-machine create -driver virtualbox node', Does it create a node of OS RHEL?
clear and excellent demo on this topic Docker Swarm
Thanks for watching Jayakumar
Hi Raghav,
Could you please help me out how to do docker swarm build using ansible?
Thanks
Hi Ranjit, I am yet to work on Ansible. I will suggest to get some online help meanwhile
Very good notes .. good job Raghav
You're welcome
Hi Raghav
Your videos are very helpful
Do we have more videos to come?
In how many more sessions will complete the Docker
Thank you
Hi Shaik, I will be adding more sessions soon. You can subscribe to get notified.
Perfect tutorial.
Only 1k likes? Common guys
Thanks for watching.
Hi Raghav, it's a nice video. but here I have a doubt. when i run docker-machine -v it gives me below statement
Command 'docker-machine' not found, but can be installed with:
snap install docker.
I have already installed docker on AWS ubutnu server. Please could i know what is the difference between docker-machine and docker thanks
Hi, Raghava, this link has a good answer pls check - www.edureka.co/community/51049/how-is-docker-machine-different-from-docker-engine
Video was awesome, thanks for sharing with us.
I have 1 doubt, how did you pull nginx docker image and run the service
Hi Samresh, Not sure if I have shown in the same video, Will have to watch the video again. You can see all videos in this playlist ruclips.net/p/PLhW3qG5bs-L99pQsZ74f-LC-tOEsBp2rK
Hi Raghav,
Thanks for the uploading this Video. I have a quick question we have 3 containers in one virtual machine. Openam, Opendj, and MySQL. we created this system for single sign-on.Mysql and opendj is a database. Openam is a web service.
Will this method work in our system? How many nodes, I need to create for each container?
Hi, ideally this should work, but I do not have any practical exp of this setup, I will suggest you try and also take some online help
Thank you Raghav @@RaghavPal
Hi Raghav, you are explaining every module of docker on your Mac OS, mostly we use redhat or windows OS and very less usage of Mac, can you also explain how to install it on LINUX OS as well, thanks for your videos
Sure Kiran, I will check on that.
do you have a session about Docker runners and Docker containers for a CI/CD environment using GitLab?
Linda
I have separate videos and playlist on Docker and GitLab, but not in a single video. Can check here - automationstepbystep.com/
Very nice thanks a lot Raghav.. waiting for Shell scripting,Ansible,Terraform..
Most welcome Gopinath, Will do very soon.
When multiple containers are running on the same VM with same port mapping, why is there no conflict in running the containers? When we access nginx instance on any VM having multiple containers of nginx running, which instance of nginx does the browser point to?
Hi Sachin, very good question. This is due to INGRESS AND ROUND ROBIN LOAD BALANCING
This explains it beautifully
stackoverflow.com/questions/46407531/docker-swarm-scaling-behaviour-on-port-mapping
forums.docker.com/t/how-does-docker-swarm-map-ports-twice/41623
blog.scottlogic.com/2016/08/30/docker-1-12-swarm-mode-round-robin.html
Thanks for replying and answering the question 😊
Hi Raghav,
If i have 50 micro services, than i have to create 50 different managers and there workers or i can run all 50 services in single manager with 2 defined workers ?
Hi Gaurav, Depends on how you need to scale up / down / start or stop services. You should be able to do with less managers. Does not need 50 managers for 50 microservices
I have a question. When we pull an image suppose of mysql, then do we need to create a service for it as well in docker-compose.yml file? And if we have another service running that is using python in it, then do we need to connect that service with the database service in docker-compose file by connecting them via network if we are trying to use database connection in the python file used in another service that is running?
Hi Vaidehi, this will depend on your needs and based on your needs you will put the information in dockerfile, I will try to show an example soon, Can watch the existing dockerfile videos
Thanks Raghav. it is very useful for the beginner like me.
Glad to know this Thiyagarajan
Awesome training materials Raghav. It helped me a lot to understand docker as well as to use it. :)
Happy to know this Shuvhashis
Great Video! Very easy to follow!
Happy to know Tyler
Thanx, Followed your series till the end and now I can easily understand documentation and implement docker.
So happy to know this. All the best
Hi Raghav. Thank you for another awesome tutorial. I am getting confused between docker compose and docker swarm. Unable to differentiate between them. Both of them provides scaling option.
Also, @28:04 updating the version randomly started the service on worker2 and shut it down on worker1 whereas before there was nothing working on worker2.
Hi Shivam, hope you have seen both the videos.
Docker Compose is used to setup application with different components. So you can create multiple containers and connect them for the application to work.
Docker Swarm is an orchestration tool
Here is good information - www.quora.com/Whats-the-difference-between-Docker-Swarm-Docker-Compose-and-Docker-Networks
Thanks for this.
I managed to set up 3 managers and 2 workers and point my domain to all 5 ip addresses of the 5 nodes. I then ran a test using nginx service and all works fine, however I noticed that sometimes it takes a while for the nginx page to load espscially if i kill one node, it take over 20 seconds for the nginx page to show
When I disable the swarm and remove all the nodes and run the service only in one node all works fine but as soon as I set up the swarm then issue start again. All the nodes are in the same Digitalocean datacenter.
your advice will be highly appreciated.
Hi Thebe, this may need some deep troubleshooting, Platforms like Kubernetes do handle such issues, but I will suggest to try checking logs in detail
@@RaghavPal Hi Raghav,
Thanks for the reply.
The problem was the ports, every thing worked perfectly as soon as I opened Port 7946 TCP/UDP for container network discovery and Port 4789 UDP for the container ingress network. I hope this info will help someone one day.
Great tutorial, easy to understand and very good example. Thank you very much!!
You are welcome!
I'm new here. Could you please tell me why we would want multi instances (containers) of 1 service on the same machine? for example in this video, what's the point of having 2 nginx container on worker1 machine? And is the port of the 2nd instance also :80?
Also, as I understand, all the nodes in a Docker swarm are inside 1 physical computer. Docker swarm is not used to manage nodes remotely via internet (for example, if I have some EC2 instances and each of them have many nodes, I cannot setup to control them from my personal computer). Is that correct?
Hi Lê Thái,
We have multiple containers that should work together to solve a business problem. In real world managing these multiple containers separately will be a difficult task. Wish docker swarm, we can do all this management of containers, scaling services, orchestration etc easily
You will get more info here
developer.ibm.com/dwblog/2017/what-is-docker-swarm-cluster-engines/
an awesome video on Docker swarm.. appreciated for posting this.
Thanks Ravi
Awesome session, But could you please tell me the difference between Replicas and Scale up?
Hi Muthu, replicas are duplicate copies, and scaling up means creating the replicas
The video is very useful for me! Thank you very much!
Glad it was helpful!
Hello raghav, the videos are good but I am seeing that you missed on important piece of docket networking
Thanks, Murali. I will add Docker Networking in some time
@@RaghavPal thanks Raghav
Thank you for such a useful video.
Most welcome Baji
Excellent procedure and thanks very much to share your skill
You're welcome Fabiano