Docker Swarm| Step by Step | What is Docker Swarm | How to create Docker Swarm
HTML-код
- Опубликовано: 29 сен 2024
- Free Tutorials - automationstep...
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)docs.docker.co...
docs.docker.co...
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”
stackoverflow....
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:
docs.docker.co...
rominirani.com...
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
• Docker
RUclips PLAYLIST
/ @raghavpal
RUclips
/ automationstepbystep
Share your knowledge with everyone and,
Never Stop Learning
Raghav
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?
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/
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
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
Thank you for such a useful video.
Most welcome Baji
Thanks, simple and easy to understand.
Glad it was helpful!
clear and excellent demo on this topic Docker Swarm
Thanks for watching Jayakumar
This is by far the best docker tutorial series on RUclips!
So happy & humbled to see your message Keshav
Awesome videos Raghav can you make it on kubernetes also it will be very helpful
I will do Kiran
U r a gift for us bro by youtube ,thanks a lot !!
Thanks a lot Sudhir. Means a lot
Superb ....!!!!
Thanks for your message Sanket
Nice videos
thanks for watching Lakshmi
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
If docker used virtualbox then how does this docker container claims to be different from virtualization ?
Hi Suman, here is some discussion on this www.quora.com/Why-does-Docker-ToolBox-use-the-Oracle-VirtualBox
stackoverflow.com/questions/48251703/if-docker-runs-natively-on-windows-then-why-does-it-need-hyper-v
hi raghav
not able to create docker machine on centos host runinng on virtual box on windows
it is waiting for IP
I used following command
docker-machine create --driver virtualbox --virtualbox-no-vtx-check myvm1
please help
Hi Anurag, here are some options and solutions. Pls see what works for you
github.com/docker/toolbox/issues/457
1. uninstall your virtualbox and remove all registrys of it2. reboot then install it again on youre cmd with VirtualBox-5.0.XXXX-Win.exe -msiparams NETWORKTYPE=NDIS53. go to control panels > security > then on firewalls > advance settings ( i dont know what its written on english)4. and on Inbound Rules, create a new one5. selecting the Custom mode.
write the local IP there justlike what i wrote on my blog
`192.168.99.1
then
192.168.99.0
192.168.99.100
`6. choose public as youre profile7. after that, make sure that the IP(192.168.99.1) configuration is same with the one on youre virtualbox hostonly adapters and in the one your network adapters(virtualbox hostonly adapter)8. reboot, make docker-machine by the terminal docker-machine -d virtualbox default
After installing VirtualBox, I could able to see VBoxManage and VirtualBox..also I am able to access both..but ..still while creating docker machine
sudo docker-machine create --driver virtualbox manager1
I am getting below error
Error with pre-create check: "VBoxManage not found. Make sure VirtualBox is installed and VBoxManage is in the path"
Hi Sumanshu, I have not encountered this and checked online
Some issue with VirtualBox installation. A user followed these steps
1. Reinstalled virtualbox
2. Renamed VBoxManage to match casing
3. Followed this guide to reinstall Docker Machine.
docs.docker.com/machine/install-machine/
3. Reinstalled bash completion scripts in etc/bash_completion.d/
sudo docker-machine create --driver virtualbox default
github.com/docker/machine/issues/4590
One question, when we upscaled the service, we saw 2 containers running on manager 1. How can we access the nginx running on those 2 containers? caz ip of the manager1 is the same but 2 nginx running inside manager 1 in 2 containers
Hi Saurav, yes, so here we can have multiple containers running on one machine, this is completely fine. In case you think about ports while scaling, While Scaling, you could get arbitrary range of ports assigned since the ports are randomly assigned by Docker engine.This can be controlled by assigning port range on the ports section of compose yaml file.
ports: - "6379-6385:6379"
nice video btw it really helped and Nginx is pronounced as "ENGINE X"
Thanks Jackson
$ sudo docker-machine create --driver virtualbox default
Running pre-create checks...
Error with pre-create check: "This computer doesn't have VT-X/AMD-v enabled. Enabling it in the BIOS is mandatory"
Any idea how to resolve in ubuntu 16.04 ? Please guide
Hi Javed, you will have to go to your BIOS setting. You can follow this - localbyflywheel.com/community/t/windows-help-im-getting-a-bios-error-about-vt-x-amd-v-during-installation/426/2
please provide the auto-generated english.. it'll very useful for me
Hi Ihsan, I will check on this, Usually it gets generated automatically
"brew cask install virtualbox" is not working. Error- Installing casks is supported only on macOS.
Hi Premchandra, what OS are you using.
Ubuntu. Even installed full virtualbox from tecadmin.net/install-oracle-virtualbox-on-ubuntu/ but not luck. I am new to Linux and even in Mac world.
Ok, at what exact step do you get this. I do not have a lot of familiarity with this issue, so can suggest you to find out online
@@RaghavPal same step as in ur video and above command having cask. Anyways thanks I will try to figure out.
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
-
Instructions are not clear buddy. Try and explain which machines are you running each commands on? Whether it's a manager or any one of the nodes.
I will plan to make it more simple and clear Sumit
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 😊
I'm doing this tutorial on Alpine Linux, and as of 23 June 2019, you can use 'docker swarm' to start the process (version string is 18.09.6-ce). Viewing the nodes (workers, manager, etc) "docker node ls" and you might want to suggest people go to "github.com/docker/machine/releases/" to get docker-machine if it's not available by package on their linux instance (Alpine did not have a package for it, oddly)
Thanks for the information. Appreciate
@@RaghavPal thank you... the whole series of videos is very helpful.
Thanks Raghav. I have a issue while creating docker machine. I am using windows 10. Can you pls hep me here
$ docker-machine create --driver hyperv manager1
Running pre-create checks...
Wrapper Docker Machine process exiting due to closed plugin server (connection is shut down)
Error with pre-create check: "read tcp 127.0.0.1:52352->127.0.0.1:52351: wsarecv: An existing connection was forcibly closed by the remote host."
Hi Purni, not sure the real cause on your system. Try to get some information from here - github.com/docker/machine/issues/2318
Hi Raghav
I like your videos very much.. Thanks for taking out time and preparing all this tutorial.
just wanted to check will there be a kubernetes playlist soon..
Hi Akshay, its in my list but can take some time.
@@RaghavPal Dockers Networkings please as Video 15
Hi Raghav, This video is very informative.Request you please make video on kubernetes
Thanks Girish, will take up Kubernetes soon
@@RaghavPal Waiting for Kubernetes Videos Brother.
Hi Raghav ,this is very nice tutorial for docker . One request for you please make Kubernetes tutorials also.
Hi, sure I will take that up soon
Hi raghav please make kubeenetes video
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
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! 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.
an awesome video on Docker swarm.. appreciated for posting this.
Thanks Ravi
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.
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
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
Hello, following the tutorial: docs.docker.com/get-started/part4/#create-a-cluster you have to create virtual machines with virtualbox driver or hyper-v as the case may be.
After creating the VMs, I run the following node in the leader node:
docker service create --name my_web --replicas 1 --publish published = 8080, target = 80 nginx
and when entering the browser with the IP of the VM, the connection is rejected.
In github I have seen many similar problems but I do not see solutions, something like this has happened to you? you can help?
Not encountered this. If anyone in this community knows anything, please help.
Hi sir, thanks for the videos. The best and the easiest tutorials to watch and learn.
However, I am getting this error "Error with pre-create check: "VBoxManage not found. Make sure VirtualBox is installed and VBoxManage is in the path" when I run this command docker-machine create --driver virtualbox dev. I have docker-machine installed. Please help. Thank you!
Hi Sai, Just run the below command on master to initialize the swarm.
docker swarm init --advertise-addr=Master_IP(elastic/Private IP)
the above command o/p will have the command to add worker to swarm like below
To add a worker to this swarm, run the following command:
docker swarm join --token SWMTKN-1-370go4yy2tnj939mhvt81xedbyven100ufrchld5iijuk6fpb2-6er2catnlhnt3adee971cj22i 172.31.84.14:2377
run this command on worker and see the nodes with docker node ls command on master.
Note: make sure to open the ports to communicate both the servers.
when you are using windows 10 home you need to use the docker-machine create --driver virtualbox manager1
else you will get the following error:
Error with pre-create check: "read tcp 127.0.0.1:53242->127.0.0.1:53241: wsarecv: An existing connection was forcibly closed by the remote host."
Thanks for adding Prashanth
can you please help me this error in Linux?
while executing this (docker-machine create --driver virtualbox manager1) command in docker-machine i am getting error in linux:(Error with pre-create check: "VBoxManage not found. Make sure VirtualBox is installed and VBoxManage is in the path"
)
Raghav
Check these
github.com/docker/machine/issues/4590
stackoverflow.com/questions/45836296/error-with-pre-create-check-vboxmanage-not-found-make-sure-virtualbox-is-inst
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
Hello Raghav Docker Swarm is very helpful, how ever are you going to do any series on Kuberneties
Hi Srikanth, I will do Kubernetes in some time
@@RaghavPal Do Kubernetes as soon as possible as a request Raghav ..iam waiting eagerly..
while executing this (docker-machine create --driver virtualbox manager1) command in docker-machine i am getting error in linux:(Error with pre-create check: "VBoxManage not found. Make sure VirtualBox is installed and VBoxManage is in the path"
)
How can I resolve this error in linux?
Hi Venkat, Here are some options and steps used by people
github.com/docker/machine/issues/4590
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
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/
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
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
Hi Raghav
Can you please explain how woker1 be in shut down state.. When you updating the service.. And nginx was not updated there... Please check from28 to30 min of the video.. It would be very helpful if u explain that
Hi Rahul, I will check
hey m getting the following error:
Error response from daemon: rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection closed
Hi, this mostly can be due to firewall settings on your network. Pls check these links
stackoverflow.com/questions/64145111/docker-swarm-join-connection-error-from-other-instance-and-local-pc
forums.docker.com/t/error-response-from-daemon-rpc-error-code-unavailable-desc-grpc-the-connection-is-unavailable/39066
github.com/getgauge/gauge-java/issues/409
@@RaghavPal hey thanks alot for replying..still stuck with the task..will try one of the above links..
@@RaghavPal also can you tell me as to why am I able to join the swarm as a manager but cannot join as a worker node?
Hi, I will need to check this online, will update if I get anything
@@RaghavPal hey..so I checked ol..so when I 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 my 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...and thanks for following up..you can include this solution in the description or something so that it will be readily available to someone who is facing the same problem..keep uploading such helpful tutorials..thanks again👍
Hi,
I have 3 nodes
1) 154.23.1.123 - Manager
2) 165.23.1.178 - Node 1
3) 171.23.3.155 - Node 2
My service is web application - I need to link IP to my domain (A record)
If i link my domain to Node 1 IP - If node 1 down -I application not accessible
How to handle this scenario -Please help me
Hi, not very sure, Will need to check this.
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
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
Thanks Raghav - very clear and well organised tutorial. Thank you for putting this together.
You're welcome
Not just Swarm, now I also know what docker-machine is for. Thank you.
So happy to know this Abbas. Best wishes
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
I just have a small doubt I have docker desktop installed on my system and these docker-machines are not recognized on my system. Do I have to separately install Dockor Toolbox on my system??
Hi Baji, what is your OS, this will help you
nickjanetakis.com/blog/should-you-use-the-docker-toolbox-or-docker-for-mac-windows
After scaling service we have 2 nginx on same machine, both with same http port 80. In browser I can access nginx with the machine IP, but which nginx(container) in the machine is it accessing. How do you access the second one.
Hi Moe, it should be a diff container, you can get the container details and check
my manager is created but it is showing error machine does not exist while am giving ls....
docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
default - virtualbox Stopped Unknown
manager1 - virtualbox Error Unknown machine does not exist
this is the thing i got..... can you help me on this
Hi Raji, did you try online help on this
Check this - github.com/prakhar1989/docker-curriculum/issues/27
6 years tutorial but still relevant. You have earned a subscriber even if i dont come back. Thank you.
Thanks a lot Osei
nice video. while trying to install in linux machine, i am getting this error can you please check and let me know the solution "Error with pre-create check: "Powershell was not found in the path"
Hi Dinesh, was checking online. Pls see these links:
www.techietown.info/2018/03/docker-error-powershell-not-found-path/
github.com/docker/hub-feedback/issues/918
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.
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.
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
May i know what is the difference between the auto scaling vs load balancing in docker and Using docker swarm we can achieve load balancing and auto-scaling and how we can scale up and down the spring boot application based on requests using docker swarm and May i know docker swarm to achieve client side load balancing
Hi Sai, load balancing is distributing load evenly on the servers
automationstepbystep.com/2020/04/28/a-story-what-is-load-balancer/
where as scaling up or down is adding or removing servers based on needs and requirements.
You can find some examples for spring boot online
docker service create --replicas 3 -p 80:80 --name serviceName nginx...This command is directly creating containers ???
Hi Susmit, so this command creates the service. Now it depends on the options you provide with the command. Check this - docs.docker.com/engine/reference/commandline/service_create/
hey Raghv thanks, the noun Nginx , is usally pronounced as Engine X. Thanks ------mutual learning.
Yes, I got to know that earlier, thanks for helping
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/
(docker machine stop worker1) you said that we have to run the command outside , outside means.we have only 3 nodes so where we have to apply the command.
Hi Pauras, I may have meant outside of that node
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
Amazing tutorials!! Appreciate you, Raghav! Thanks again!
Most welcome Pavon
Hi Raghav, I am expecting a video from you regarding Docker stack and difference between docker stack and docker compose. thanks
Okay, will take a note of this.
You are brilliant man!! Love from United States!
Thanks a lot Aman, Honored and humbled by your message
Hi @Automation Step by Step - Raghav Pal Thanks for this video. helped me understanding the concepts. I have followed the same steps to create Docker swarm using command ""docker-machine -D create --driver virtualbox --virtualbox-no-vtx-check manager1""" , I am getting error/ gets stuck at waiting for IP... This endup with err 255 "Error in driver during machine creation: Too many retries waiting for SSH to be available. Last error: Maximum number of retries (60) exceeded". Could you please help me solve this issue.
Hi Mohammed Saleel, check if this helps stackoverflow.com/questions/35598922/not-able-to-add-host-using-docker-machine
@@RaghavPal Thanks for your reply.
Just a question: what would be the port nginx running if two instances are running on same manager and we have not explicitly mentioned the port.
Hi Raziq, While Scaling, you could get arbitrary range of ports assigned since the ports are randomly assigned by Docker engine.This can be controlled by assigning port range on the ports section of compose yaml file.
ports: - "6379-6385:6379"
medium.com/@karthi.net/how-to-scale-services-using-docker-compose-31d7b83a6648
Very nice thanks a lot Raghav.. waiting for Shell scripting,Ansible,Terraform..
Most welcome Gopinath, Will do very soon.
not able create vm machine on amzn ec2 Linux machine getting an error when installing VirtualBox " Creating CA: /root/.docker/machine/certs/ca.pem Creating client certificate: /root/.docker/machine/certs/cert.pem Running pre-create checks... Error with pre-create check: "VBoxManage not found. Make sure VirtualBox is installed and VBoxManage is in the path""
Hi Kashish, as mentioned in the logs did you try installing virtual box
@@RaghavPal yes m trying but getting error nd not able to install
You are really fantastic, very awesome tutorial.but also make video on docker networking please.
Sure will plan
How to install DOcker swarm in Ubuntu ,Error with pre-create check: "VBoxManage not found. Make sure VirtualBox is installed and VBoxManage is in the path"
when i use command docker-machine create --driver virtualbox manager1
Hi, see if this helps stackoverflow.com/questions/45836296/error-with-pre-create-check-vboxmanage-not-found-make-sure-virtualbox-is-inst
@@RaghavPal Thankyou... anyhow i installed in AWS with one Manager and two worker Nodes.
I tried following command but I am getting error
command: docker-machine create --virtualbox-no-vtx-check default
error message: unknown flag: --driver
Manikandan
The error message "unknown flag: --driver" indicates that the `docker-machine create` command you used is not compatible with your version of Docker Machine. The `--driver` flag is only supported in newer versions of Docker Machine.
However, your command includes the `--virtualbox-no-vtx-check` flag, which suggests that you are using an older version of Docker Machine. In older versions, the driver is not specified as a separate flag and is instead included as part of the command itself.
Here are some ways to resolve this error:
**1. Update Docker Machine:**
* Update your Docker Machine to the latest version. This might resolve the issue if you are using an outdated version that doesn't recognize the `--driver` flag.
* You can find instructions for updating Docker Machine on the official documentation website: [stackoverflow.com/questions/59809570/how-to-update-docker-machine-on-linux](stackoverflow.com/questions/59809570/how-to-update-docker-machine-on-linux)
**2. Remove the `--driver` flag:**
* Since you are using an older version of Docker Machine that doesn't support the `--driver` flag, you can remove it from your command.
* This will allow Docker Machine to use the default driver, which is usually VirtualBox.
* Your revised command would be:
```
docker-machine create --virtualbox-no-vtx-check default
```
**3. Specify the driver explicitly:**
* If you want to use a specific driver other than the default, you can specify it directly in the command without the `--driver` flag.
* For example, to create a machine using the VirtualBox driver, you can use:
```
docker-machine create -d virtualbox --virtualbox-no-vtx-check default
```
**4. Check Docker Machine documentation:**
* Refer to the official Docker Machine documentation for your specific version to ensure you are using the correct syntax and supported features.
* The documentation provides detailed information and examples for various commands and options.
By following these suggestions, you should be able to create a Docker Swarm machine successfully without encountering the "unknown flag: --driver" error. Remember to choose the approach that best suits your specific version of Docker Machine and desired configuration.
@@RaghavPal Man just straight ChatGPT'ing that shit lmao. Correct answer is that this video became outdated only a year after its release (docker-machine was removed as a command in 2020).
Hi Raghav,
I am using Centos 7 and I am running #docker-machine create - - driver virtual box manager command, now I am getting "VBoxManage not found" error.
Then I tried # brew cask install virtualbox; command after am getting "command not found...." Error. Please help me.
Hi Anil, I will suggest that you look at some tutorials specifically for installing docker on cent os and then we can discuss more on this. Here are some links tinyurl.com/y6hhra22
Hello Anil,
please check here if you are using Mac
www.howtogeek.com/211541/homebrew-for-os-x-easily-installs-desktop-apps-and-terminal-utilities/
virtualbox error shows while running the create a docker machine can u plzz tell me the commond using ubuntu
Hi Faizan, this can help stackoverflow.com/questions/33935800/how-can-i-create-ubuntu-based-docker-host-by-using-docker-machine-with-virtualbo
what is the role of master node? it acts like a worker node. I thought it will work like load balancer request will come to the master node and master will send to worker.
Hi Pradeep, check this docs.docker.com/engine/swarm/how-swarm-mode-works/nodes/
Why do I keep getting 'docker-machine' is not recognized as an internal or external command,
operable program or batch file. I installed Docker, version 19.03.5, on my windows 10 machine.
Other docker commands run fine. :/
Hi Amandeep, have you installed it. Pls check here - docs.docker.com/machine/install-machine/
Docker Machine appears to be deprecated. Is there an alternative to this? I presume it's time to move to K8?
I will check on this
Super.. could you please make videos on Kubernetes.?
Sure Kumaresh, i will do it soon
how to use docker swarn or create swarn from and docker compose. is it posible .. i have setup django on docker compose now cant move to swarn
Hi Sourav, this may help you - dzone.com/articles/deploy-docker-compose-services-swarm
Thank you Raghav.. Your Tutorials are very easy to understand and as simple as your explanation.. Great job..
You're welcome
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.
32:03 i was like who is playing my guitar 😱😂. btw nicely explained. Thank you Sir . 👍
You're welcome
Is it possible to run multiple services e.g. wordpress and nginx (separatly from each other) on one worker node? If "yes" how can i access these services? In your example we access the nginx webserver via the ip adress, so if we have two (or more) serivces on one node, do we need the port number additionaly?
Hi, You can have 2 services on one node.
While Scaling, you could get arbitrary range of ports assigned since the ports are randomly assigned by Docker engine.This can be controlled by assigning port range on the ports section of compose yaml file.
ports: - "6379-6385:6379"
medium.com/@karthi.net/how-to-scale-services-using-docker-compose-31d7b83a6648
Hi, You can have 2 services on one node.
While Scaling, you could get arbitrary range of ports assigned since the ports are randomly assigned by Docker engine.This can be controlled by assigning port range on the ports section of compose yaml file.
ports: - "6379-6385:6379"
medium.com/@karthi.net/how-to-scale-services-using-docker-compose-31d7b83a6648
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/
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
Hi Raghav
Your video are so helpful for beginner, thank you for posting the videos
Most welcome Vijay
hi raghav , best concept for docker on. i request you please add some lecture on python.
Thanks Ajay, I have some sessions already added for Python. You can check in the channel playlist. I will add more soon
You are awesome Raghav. I love the way you explain things from scratch. Thanks much.
You're welcome Parul
Just a question for you when you scale. We only one three IP addresses exposed I'm missing how the system uses the new node when you scale up with only 3 IP addresses exposed for the services. Can you help me understand what I"m missing.
Hi, 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
Automation Step by Step - Raghav Pal Thanks for getting back with me on this and the link.
Can't help thinking how could someone dislike a free tutorial as good as this. Thank you very much Raghav!
Most welcome Vivek
Error response from daemon: Timeout was reached before node was joined. The attempt to join the swarm will continue in the background. Use the "docker info" command to see the current swarm status of your node.
im getting this error
Hi, you will need to check if the ports are open. Pls check this
forums.docker.com/t/fail-join-node-as-worker/48321
stackoverflow.com/questions/38693560/docker1-12-worker-not-able-to-join-in-clusterswarm-pending
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
Nice video. What a clear and clean explanation. Thank you..! For the video..
Most welcome