ElasticSearch and Docker

  • It’s a Java application, but running in Docker, you can treat it as a black box and manage it in the same way as all other Docker workloads—you don’t need to install Java or configure
    the JDK.
  • Elasticsearch exposes a REST API for writing, reading, and searching data, and there are client wrappers for the API available in all major languages.
  • Data in Elasticsearch is stored as JSON documents, and every document can be fully indexed so that you can search for any value in any field. It’s a clustered technology that can run across many nodes for scale and resilience. In Docker, you can run each node in a separate container and distribute them across your server estate to gain scale and resilience, but with the ease of deployment and management you get with Docker.
  • The same storage considerations apply to Elasticsearch as they do to any stateful workload—in development, you can save data inside the container so that when the  container is replaced, you start with a fresh database. In test environments, you can use a Docker volume mounted to a drive folder on the host to keep persistent storage outside the container. In production, you can use a volume with a driver for an on-premises storage array or a cloud-storage service.

Adopting Container-First Solution Design

There’s an official Elasticsearch image on Docker Hub, but it currently has only Linux  variants. I have my own image on Docker Hub which packages Elasticsearch into a Windows Server 2019 Docker image. Running Elasticsearch in Docker is the same as  starting any container. This command exposes port 9200, which is the default port.

ElasticSearch on AWS

The service offers open-source Elasticsearch APIs, managed Kibana, and integrations with Logstash and other AWS Services, enabling you to securely ingest data from any source and search, analyze, and visualize it in real time.