Skip to content

rapolaskaseliscgi/es-docker-env

Repository files navigation

Elasticsearch cluster in docker

Install and run elasticsearch V7 on docker environment

Steps to run:

  1. build docker image:
  docker build . -t ubuntu-systemd:latest
  1. run docker compose:
  docker compose up --build

This should give a running green cluster of two nodes

Optional to copy some data:

  1. Setup ssh tunnel to demo environment to expose elasticsearch on port 10200
ssh -L 10200:ccd-elastic-search-demo.service.core-compute-demo.internal:9200 bastion-nonprod.platform.hmcts.net
  1. Copy some elasticsearch data from demo (bail_cases-000001 is index to copy):
  ./copy-index.sh bail_cases-000001

To restart from scratch

  1. Stop docker compose

  2. Run clean environment script:

  ./cleanup-env.sh
  1. Repeat steps on "Steps to run"

register directory for data snapshots

curl -sS -X PUT "http://localhost:9200/_snapshot/my_fs_repo" -H 'Content-Type: application/json' -d'
{
  "type": "fs",
  "settings": {
    "location": "/usr/share/elasticsearch/backup",
    "compress": true
  }
}
'

Take snapshot:

curl -sS -X PUT "http://localhost:9200/_snapshot/my_fs_repo/snap_2026_03_10?wait_for_completion=true"

List snapshots:

curl -sS "http://localhost:9200/_cat/snapshots/my_fs_repo?v&s=start_epoch:desc"

restore from snapshot:

curl -sS -X POST "http://localhost:9200/_snapshot/my_fs_repo/snap_2026_03_10_9-indices/_restore" -H 'Content-Type: application/json' -d'{"include_global_state": true}'

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors