1

I have an installation of Elasticsearch without persistence running and I need to back it up so we can move it to a persistent setup.

What are safe ways to do this and keep the data in the ES database?

It is running and I want to avoid shutting it down.

It is running in a container and I think the entrypoint starts the server. So stopping the cluster my stop my pod and get rid of all my data...

David West
  • 1,533
  • 3
  • 18
  • 25
  • 1
    Maybe https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html – Tensibai Aug 30 '18 at 15:22
  • @Tensibai it looks like you need to define repos to do this and that seems to require restarting the cluster... – David West Aug 30 '18 at 16:59
  • I don't understand why you think that, you do a put request to create a local (in container) repo, another put to create the snapshot and then docker cp this location to host, shut you cluster down, bring it back up with volume mounts or whatever, docker cp to container and restore the snapshot... – Tensibai Aug 30 '18 at 18:04
  • @Tensibai we just moved our cluster. we did not back up the data and just took the loss. now it has persistance. The whole reason we couldn't use snapshots was because that required shutting the cluster down and bringing that back up. With our setup that got rid of the data :) – David West Sep 01 '18 at 17:07
  • You're not willing to accept that a snapshot can be take locally to the container and then copied with docker commands. We can't do anything more for you – Tensibai Sep 01 '18 at 21:50
  • You can't create a remote repo as S3, but local disk is always available, you need to target one node of the cluster to find the snap after, but well... – Tensibai Sep 01 '18 at 21:51
  • @DavidWest "snapshots required shutting the cluster down" ... it is wrong, it requires no such thing. – Evgeny Zislis Sep 01 '18 at 22:28

1 Answers1

1

ElasticSearch can backup itself when told to do so via an API call. You just need to configure a destination, and optionally credentials, for example you make ElasticSearch create snapshots of its database in AWS S3.

https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html

You can also automate these calls using a schedule with the Elastic curator tool.

https://www.elastic.co/guide/en/elasticsearch/client/curator/5.5/snapshot.html

Evgeny Zislis
  • 9,023
  • 5
  • 39
  • 72