Docker Swarm

Docker Swarm is a container orchestration tool which allows users to manage multiple containers with ease. With its help containers can be easily deployed across various host machines. Docker swarm offers high level of availability for applications.

Container Orchestration System

If you need to run hundreds of containers a container orchestration system is required. You can easily see that if they are running in a distributed mode, there are multiple features that you will need from a management point of view to make sure that the cluster is up and running without errors.

Some of these necessary features include:

  • Health Checks on the Containers
  • Launching a fixed set of Containers for a particular Docker image
  • Scaling the number of Containers up and down depending on the load
  • Performing rolling update of software across containers

Setup a cluster with Docker Swarm

We will use AWS ec2 for setting up the cluster, so we will launch 3 Ubuntu 18.04 machine from AWS marketplace, 1 will be master node and other 2 will be worker nodes.

Each node must also be running Docker.

Install Docker

Curl -ssl | sh

This will install the latest version of Docker engine.

Create Swarm Manager

Run the command below on the manager machine.

sudo docker swarm init –advertise-addr

The output will be like:

Save the token from the above output, this will be used to add the nodes to the cluster.

You can see the nodes in the cluster with the command below:

Add Nodes to cluster:

SSh to you worker nodes and install Docker in them.

Then you can join the cluster by entering the token we have saved above with swarm join command.

Run this command in both the nodes.

Then go back to the master node and run the following command to check how many nodes have joined.

Deploy a sample service on cluster.

It will create a service for the nginx web server.

You can list and check the status of the service.

Clustering made easy with Swarm

That’s the gist of creating a Docker swarm and creating a service on your new cluster. To learn more about what Docker swarm can do, issue the command Docker swarm — help to see the other commands you can use for Docker swarm.

If you need help in configuring this cluster, feel free to email us or call us at +1 810 214 2572

92 thoughts on “Docker Swarm”

  1. 599318 844106I like this internet site really significantly, Its a quite nice position to read and receive information . 420557

  2. 35663 978177Youre so appropriate. Im there with you. Your weblog is surely worth a read if anyone comes throughout it. Im lucky I did because now Ive obtained a complete new view of this. I didnt realise that this issue was so important and so universal. You definitely put it in perspective for me. 843487

  3. Wow that was strange. I just wrote an extremely
    long comment but after I clicked submit my comment didn’t
    appear. Grrrr… well I’m not writing all that over again.
    Regardless, just wanted to say excellent blog!

  4. It is not my first time to go to see this website,
    i am visiting this web site dailly and obtain pleasant facts from here everyday.

  5. Currently it appears like WordPress is the top blogging platform available right now.

    (from what I’ve read) Is that what you are using on your blog?

  6. When someone writes an post he/she maintains the plan of a
    user in his/her brain that how a user can be aware of it.
    Therefore that’s why this article is perfect. Thanks!

  7. Appreciating the dedication you put into your site and detailed information you present.

    It’s great to come across a blog every once in a
    while that isn’t the same old rehashed material. Great read!
    I’ve saved your site and I’m including your RSS feeds to my Google account.

  8. Hello! I realize this is somewhat off-topic but I needed to ask.
    Does operating a well-established website like yours take a massive amount work?
    I am completely new to running a blog but I do write in my journal
    every day. I’d like to start a blog so I can easily share
    my experience and feelings online. Please let me know if you have any ideas or
    tips for brand new aspiring bloggers. Appreciate it!

  9. First of all I want to say excellent blog! I had a quick question that I’d like to ask if you don’t mind. I was interested to find out how you center yourself and clear your thoughts prior to writing. I have had a hard time clearing my mind in getting my ideas out there. I truly do enjoy writing however it just seems like the first 10 to 15 minutes are generally lost simply just trying to figure out how to begin. Any recommendations or hints? Appreciate it!|

  10. Hi, i read your blog from time to time and i own a similar one and i was just wondering
    if you get a lot of spam responses? If so how do you prevent it, any
    plugin or anything you can suggest? I get so much lately it’s
    driving me crazy so any assistance is very much appreciated.

  11. magnificent issues altogether, you just gained a emblem
    new reader. What would you recommend about your publish that you made some days ago?
    Any sure?

  12. I was curious if you ever thought of changing the page layout of your website?
    Its very well written; I love what youve got to say.

    But maybe you could a little more in the way of content so people could connect with it better.
    Youve got an awful lot of text for only having one or two
    images. Maybe you could space it out better?

  13. Just wish to say your article is as surprising. The clearness
    in your submit is simply excellent and i can think you are knowledgeable in this subject.
    Well with your permission let me to snatch your feed to keep up to date with
    drawing close post. Thanks one million and please carry on the enjoyable

Leave a Comment

Your email address will not be published.