How to Install Docker Swarm Cluster with Auto-Clustering and Auto-Scaling?

How to Install Docker Swarm Cluster with Auto-Clustering and Auto-Scaling?

A swarm cluster is like a group of special computer parts (Docker Engine nodes) that work together smoothly to run computer programs. It’s good at keeping your computer programs running constantly by spreading the work across different computers and places where they’re stored. Additionally, it has some extra features like helping you recover from computer disasters and updating without causing any interruptions.

However, setting up and managing this cluster can be tricky because it’s still a relatively new technology. So, in this article, we’ll explain how to make it easy by using a special package called Docker Swarm Cluster. With this package, you can quickly create a cluster of the right size in just a few minutes. Let’s explore how to do that.

Understanding the Structure of a Docker Swarm Cluster

Installing the Docker Swarm Cluster package creates a specific setup based on two main parts: Managers and Workers.

Managers are like the organizers; they ensure everything in your cluster runs as it should, including all the programs you want to run.

Workers are like the doers; they do the actual tasks assigned to them by the Managers.

Structure of a Docker Swarm Cluster

When you set up this cluster, you can choose how many Workers you want and what kind of setup you prefer:

  • You can start with a basic cluster and then add the programs you want to run later.
  • Or you can start with a cluster with the needed programs.

Each part of the cluster is set up to use resources efficiently, and you only pay for what you use. So, even if you have eight parts in your cluster, you’ll only pay for the resources they use when they’re active.

In simple terms, you can have a reliable Docker Swarm Cluster with eight parts, and it won’t cost much to run when they’re not busy.

Docker Swarm Cluster

Hosting your swarm cluster with AccuWeb.Cloud PaaS automatically spreads out your computer programs (containers) across different physical servers to ensure your applications are always available.

Before you install this package, remember:

  • Make sure the platform you’re using supports Docker containers. You can check the list of supported providers here.
  • The option to attach a public IP to manager nodes is only available for users who pay for the service.

Save $100 in the next
5:00 minutes?

Register Here

Monitoring and Adjusting Your Swarm Cluster

The Docker Swarm Cluster package from Jelastic has some helpful features for keeping an eye on how your cluster is doing and making it work better.

Load Alerts: By default, the cluster can send you emails when it’s using a lot of resources like CPU, RAM, or network. This helps you know if there are any problems and lets you make the cluster bigger.

Load Alerts

Scaling: If your cluster needs more power, you can make it bigger vertically (by giving it more resources) or horizontally (by adding more nodes). You can set this up using the topology wizard. Having an odd number of manager nodes for better reliability is also a good idea.

Scaling Limit

Automatic Scaling: You can set the cluster to grow or shrink automatically based on how much it’s being used. For example, if it’s using a lot of RAM or CPU for a while, it can add more nodes. If it’s not used much, it can remove some nodes. To keep the number of managers odd, adding or removing nodes in pairs is recommended.

Automatic Scaling

High Availability: If you want to ensure your Docker programs stay running, you can connect nodes from different places to your cluster. You’ll get instructions on how to do this in an email after setting up the cluster.

Docker Swarm Cluster is Up and Running

So, you can keep an eye on your cluster’s health, make it bigger when needed, and even adjust itself automatically to handle more or less work.

Save $100 in the next
5:00 minutes?

Register Here

Docker Swarm Installation

Setting up Docker Swarm from the AccuWeb.Cloud Marketplace is easy and automatic. Here are the simple steps:

Step 1: Log in to your AccuWeb.Cloud account.

Step 2: Click “MarketPlace” at the top of the screen.

AccuWeb.Cloud Marketplace

Step 3: In the MarketPlace window, find “Clusters” under Applications and select “Docker Swarm Cluster.”

Docker Swarm Cluster

Step 4: Click “Install” to start the installation.

Install Docker Swarm Cluster

Step 5: In the installation window, you can adjust some settings:

  • Docker Version – Choose the Docker version you want.
  • Manager Nodes – Decide how many manager nodes you want in your cluster.
  • Worker Nodes – Decide how many worker nodes you want in your cluster.

Select your deployment type:

  • Clean Cluster for a basic cluster.
  • Deploy Stack YML to install specific dockerized services.

Provide a name for your environment and an optional display name.

For example, we will create a Docker swarm cluster with 3 managers, 5 workers, and Portainer UI with Let’s Encrypt SSL. After configuring, click “Install” and wait for a few minutes for AccuWeb.Cloud PaaS to do the rest.

Enter Environment and Display Name

Step 6: Once it’s done, you’ll receive a confirmation message with login details in your email.

Confirmation message

Step 7: Click “Open in Browser” to access the Docker cluster in your web browser.

Open in Browser

Step 8: Use the login details from the email to access your Cluster environment.

Enter Login Details

Step 9: When prompted, change the password to a new one. You can skip this by clicking “Remind me later.”

Change the password

Step 10: You’ll see the Docker dashboard after successfully changing the password.

Docker Dashboard

Docker Swarm Connection

Once you’ve installed everything successfully, you can manage your cluster in different ways:

Portainer UI

If you set up a clean cluster with Portainer UI and Let’s Encrypt SSL, you can access the control panel by opening your environment in a web browser using HTTPS (on port 443).

Docker Dashboard

Your browser might show a warning about an SSL certificate, but it won’t affect how Portainer works. You need to confirm that you want to access the page.

The steps to do this can vary depending on your web browser. For example, in Google Chrome, you might need to go to the Advanced section and click the “Proceed to {env_URL}” link. Your login details for Portainer are in the email you got after creating the Docker swarm.

SSH Gate

Connect to one of the Manager nodes using AccuWeb.Cloud SSH Gate to manage your Docker swarm. You can do this from the dashboard by clicking the “Web SSH” button for the container you want to access. Another way is to use your preferred SSH client, but you’ll need to upload your public key to the dashboard first.
Web SSH

Conclusion

In conclusion, setting up a Docker Swarm Cluster with auto-clustering and auto-scaling capabilities is a powerful way to manage and scale containerized applications efficiently. Following the steps outlined in the guide, you can create a resilient and dynamic environment for your containers.

This approach enhances your ability to handle increased workloads and ensures high availability, making it a valuable solution for modern application deployment and management. Remember that continuous monitoring and fine-tuning are essential to maximize the benefits of Docker Swarm’s auto-clustering and auto-scaling features, adapting your cluster to changing demands and maintaining optimal performance.

Save $100 in the next
5:00 minutes?

Register Here