Elasticsearch & Kibana Installation

Dependencies

Using Debian 11, Ubuntu 22.04 or later.

  1. Docker

  2. Docker-compose

  3. Nano

  4. Curl

Install Instruction

  1. Create a new folder, set as project name

$ mkdir proj
$ cd proj

2. Create docker-compose.yml file like this.

$ cat <<EOF > docker-compose.yml

version: '3'
services:
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch-oss:7.10.2
    environment: 
      - discovery.type=single-node
    ports: 
      - 9200:9200
    volumes:
     - '/docker/elasticsearch/data:/usr/share/elasticsearch/data'
    healthcheck:
      test: ["CMD-SHELL", "curl --silent --fail localhost:9200/_cluster/health || exit 1"]
      interval: 30s
      timeout: 30s
      retries: 15 

  kibana:
    image: docker.elastic.co/kibana/kibana-oss:7.10.2
    environment: 
      - ELASTICSEARCH_HOSTS=http://elasticsearch:9200
    ports: 
      - 5601:5601
    depends_on:
      - elasticsearch

3. Make directory for ES data

$ sudo mkdir -p /docker/elasticsearch/data
$ sudo chmod 777 -R /docker/elasticsearch/data

4. Using docker-compose up command to deploying containers

$ docker-compose up -d

5. Test if it is up

$ curl localhost:9200

{
  "name" : "ee9ff4c85c6c",
  "cluster_name" : "docker-cluster",
  "cluster_uuid" : "WXRDatZBTDCoAkcJminbBA",
  "version" : {
    "number" : "7.17.8",
    "build_flavor" : "default",
    "build_type" : "docker",
    "build_hash" : "120eabe1c8a0cb2ae87cffc109a5b65d213e9df1",
    "build_date" : "2022-12-02T17:33:09.727072865Z",
    "build_snapshot" : false,
    "lucene_version" : "8.11.1",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

Plugin installation

$ docker exec -it elastic_elasticsearch_1 bash
$ bin/elasticsearch-plugin install analysis-icu

-> Installing analysis-icu
-> Downloading analysis-icu from elastic
[=================================================] 100%?? 
-> Installed analysis-icu
-> Please restart Elasticsearch to activate any plugins installed

Restart the docker container

$ docker restart elastic_elasticsearch_1

Last updated