This guide helps you to deploy a Elasticsearch service in a Docker container using the D2C platform. It might be helpful for beginners as well as for advanced developers.
A container image is a lightweight, stand-alone, executable package of a piece of software that includes everything needed to run it: code, runtime, system tools, system libraries, settings. Containers isolate software from its surroundings, for example, differences between development and staging environments and help reduce conflicts between teams running different software on the same infrastructure.
Please, check out the original Docker post about containers for a better understanding of all the benefits of the technology.
Creating Elasticsearch service
At first, you need to open or create any project and click “+Create service“. You will see a list of services which can be deployed with D2C:
Let’s go ahead and click on the Elasticsearch bar.
Creating Elasticsearch service. Service settings
The name should start with a letter and contain up to 16 characters (Latin letters, numbers, hyphen).
Each service has its unique name. Services can communicate with each other by container names (e.g.
elastic-1) or alias-names (e.g.
You can choose a version for your application from a list:
In most of the cases, that is enough for deploying a database. You can now select hosts and create a service. Data services also have advanced settings. We show them below.
Creating Elasticsearch service. Select hosts
At this step you can create other hosts and choose them even they are not online yet (creating/setting up status). The containers will be deployed when they are ready.
It is recommended to use hosts with at least 4GB RAM for Elasticsearch. Here was shown just a test deployment process.
After successful deployment your project should look like:
Creating Elasticsearch service. Advanced settings
Click “Show advanced settings”.
The first block in this area is Ports.
Access from the Internet is disabled by default. You can enable access from the Internet while creating or editing service. But it is not recommended for security reasons and it is not necessary for communication with services which are running in D2C. Containers are started inside a private network and have dynamically assigned local IP addresses. Apps can reference each other by container name. It does not matter on which host the service is running – all private network intercommunication is transparent for all services in your account.
Persistent data volumes
D2C separates the application itself from its data. Docker volumes are used to store persistent data. Data is stored locally on the hosts.
D2C creates a default config for Elasticsearch. You can change it using the “Edit” button.
Click on the “Generate new config” button if you need to return to default config.
In this field, you can specify commands for installing global dependencies of your service.
Commands which are executed only once after deploying a service.
In the next article we talk about:
- maintaining data services: creating backups, scaling, checking containers logs and metrics, updating version