Docker Swarm is native clustering for Docker, which combines a group of Docker Containing hosts to form a Cluster. In this Tutorial we will form a Three Node cluster, a Master and agent node. This will contain 3 steps.
Upgrade Packages all system packages with
sudo apt-get update && sudo apt-get -y upgrade
Install Docker on all nodes.
curl -sSL https://get.docker.com/ | sh
Stop Docker and run it to listen on a port so swarm can connect
sudo service docker stop
sudo docker daemon -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock
After Installing Docker engines and set it to listen on port 2375, we now have to setup a discovery backend that can form a cluster
Discovery backend helps in identifying and grouping the clusters. There are multiple backend discovery services available like
In this tutorial we will use consul as Discovery Service.
docker run -d -p 8500:8500 --name=consul progrium/consul -server -bootstrap
On Manager Run this command
docker run -d -p 4000:4000 swarm manage -H :4000 --replication --advertise <manager0_ip>:4000 consul://<consul_ip>:8500
run docker ps to see if swarm container is running.
On Agent Nodes run the following command to join the cluster.
docker run -d swarm join --advertise=<node_ip>:2375 consul://<consul_ip>:8500
Your cluster is now formed.
From Manager node run this commands:
docker -H :4000 run -itd ubuntu
docker -H :4000 info
You can see that ubuntu is launched in one of the agent nodes which denotes a successful Cluster.
GitLab Container Registry is a secure and private registry for Docker images integrated completely in Gitlab. In this tutorial we will setup and use GitLab ...
Configuring SSL is beneficial not only for security purpose but also for SEO too.Linuxsoftware foundation's initiated a program called Let’s Encrypt to give ssl ...
Quick guide to host django application using uwsgi and nginx which offers better resource utilization and performance.
MicroPyramid - India
HIG499, 6th phase KPHB, Hyderabad, India - 500072, +91 9959166266
Monday - Friday : 10:00 - 19:00
MicroPyramid - USA
280 Moon Clinton Rd,STE D Moon Twp, Pittsburgh, Pennsylvania 15108, +1 5102300949
MicroPyramid - UAE
Khalifa Building(Near Old Nesto Super Market),Opp Fire Station, Sharjah, UAE 341246, +971 566061239