Install and run elasticsearch V7 on docker environment
- build docker image:
docker build . -t ubuntu-systemd:latest- run docker compose:
docker compose up --buildThis should give a running green cluster of two nodes
Optional to copy some data:
- 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- Copy some elasticsearch data from demo (bail_cases-000001 is index to copy):
./copy-index.sh bail_cases-000001-
Stop docker compose
-
Run clean environment script:
./cleanup-env.sh- Repeat steps on "Steps to run"
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}'