Balu
Balu Platform Engineer | Devops | Monitoring | CICD | ODD | SQL/NoSQL | ELK | AWS | Jhipster | Microservices | Agile | Scrum

Elasticsearch - Single Node using Docker Compose

Elasticsearch - Single Node using Docker Compose

Preface

This post assumes that you have some basic understanding of Docker, Docker Compose, and the key components used in the docker ecosystem. Get up to speed, with the Prepare Your Docker Eenvironment section of Docker docs.

  1. Install Docker
  2. install docker-compose

Deploy Elasticsearch Single Node

The ELK Stack (Elasticsearch, Logstash, and Kibana) can be installed on a variety of different operating systems and in various setups. The most easiest way to deploy elastic search as a container, we have Responsive deployment and scaling, Running more workloads on the same hardware which will hep developer and production environments with more flexibility.

Elasticsearch Single Node container using Docker Compose. Create the docker-compose.yml with the following

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
version: '3.7'
services:
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.7.0
    container_name: elasticsearch
    environment:
      - node.name=vibhuvi-node
      - discovery.type=single-node
      - cluster.name=vibhuvi-es-data-cluster
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms1024m -Xmx1024m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - vibhuviesdata:/usr/share/elasticsearch/data
    ports:
      - 9200:9200
    networks:
      - elastic
networks:
  elastic:
    driver: bridge  
volumes:
  vibhuviesdata:

Run

1
docker-compose up -d

Deploy Elasticsearch Single Node with Kibana

Elasticsearch Single Node container with Kibana Using Docker Compose. Create the docker-compose.yml with the following

1
https://raw.githubusercontent.com/JinnaBalu/vibhuvi-infinite-containers/master/elasticsearch/single-node.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
version: '3.7'
services:
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.7.0
    environment:
      - node.name=vibhuvi-node
      - discovery.type=single-node
      - cluster.name=vibhuvi-es-data-cluster
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms1024m -Xmx1024m"
    volumes:
      - vibhuviesdata:/usr/share/elasticsearch/data
    ports:
      - 9200:9200
    networks:
      - elastic
    deploy:
      replicas: 1
      update_config:
        parallelism: 1
        delay: 180s
      restart_policy:
        condition: on-failure      
  kibana:
    image: docker.elastic.co/kibana/kibana:7.7.0
    ports:
      - 5601:5601
    environment:
      ELASTICSEARCH_URL: http://elasticsearch:9200
      ELASTICSEARCH_HOSTS: http://elasticsearch:9200
    networks:
      - elastic
    deploy:
      replicas: 1
      update_config:
        parallelism: 1
        delay: 180s
      restart_policy:
        condition: on-failure    
      placement:
        constraints: [node.role == manager]
networks:
  elastic:
volumes:
  vibhuviesdata:

Run

1
docker-compose up -d

comments powered by Disqus