Mindmajix

Orchestration in the Docker

We need to orchestrate the Docker, and especially when using it in production environments. The Docker community released some tools which can be used for this purpose. Let us discuss some of these tools.

The Docker Swarm

This tool is used for the purpose of hosting and scheduling a cluster of Docker containers. You will learn about how to create a Docker Swarm on your machine and VirtualBox.

Each of the nodes used in the Docker Swarm should be in a position to access the Docker Hub for downloading and running images in your container. To create a Docker Swarm on your machine, follow the steps given below:

1. List all the machines available in your system. Use the following command:

Screenshot_35

2. Create a VirtualBox machine and give it the name “local.” Use the command given below:

Screenshot_36

3. The machine which has been created should then be loaded into the shell. Use the following command:

Screenshot_37

4. You should then use the Docker Swarm image so as to generate a discovery token. The following command can be used for this purpose:

Screenshot_38

If the latest image of “swarm:latest” is not found in your local system, it will be pulled to your system. The command will run verbosely, and you will observe the following output:

Screenshot_39

5. The token should then be saved in a safe place.

Launching the Swarm Manager

This is the one responsible for orchestrating and scheduling containers in the entire system. The process of hosting the containers is done by the Swarm agents. They are a kind of regular Docker daemon which you can communicate with via the Docker remote API. Let us try to create two Swarm managers:

1. Under your VirtualBox, create a Swarm manager. This is shown below:

Screenshot_40

2. Open the VirtualBox Manager, which should have the “local” machine and the “swarm-master” machine which we have just created. These are shown below:

docker orchestration

4. Create the swarm node:

Screenshot_42

5. Create another agent, and give it the name “swarm-agent-1”. This is shown below:

Screenshot_43

The two agents should now be available in your VirtualBox.

Directing the Swarm

What we need to do is to establish a connection to the swarm, show the information related to it, and then start the image related to the swarm. Follow the steps given below:

1. Begin by running the following command:

Screenshot_44

The Docker environment will be pointed to the machine which is running the swarm master.

2. Use the “docker” command so as to get information about your new swarm

Screenshot_45

Note that at this moment, the master is running both the swarm agent container and the swarm manager. However, this is not a good technique in a production environment since the agent can develop problems.


0 Responses on Orchestration in the Docker"

Leave a Message

Your email address will not be published. Required fields are marked *

Copy Rights Reserved © Mindmajix.com All rights reserved. Disclaimer.
Course Adviser

Fill your details, course adviser will reach you.