# Backup of Elasticsearch

**URL:** <https://discuss.elastic.co/t/backup-of-elasticsearch/332816>\
**Category:** Elasticsearch\
**Tags:** snapshot-and-restore\
**Created:** [May 8, 2023, 12:27pm UTC](https://discuss.elastic.co/t/backup-of-elasticsearch/332816 "2023-05-08T12:27:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![raw](https://avatars.discourse-cdn.com/v4/letter/r/6bbea6/32.png) [@raw](https://discuss.elastic.co/u/raw)\
**Post date:** [May 8, 2023, 12:27pm UTC](https://discuss.elastic.co/t/backup-of-elasticsearch/332816/1 "2023-05-08T12:27:02Z")

</div>

I have a cluster of 3 nodes. I have set the backup directory on the 3 nodes to be: /var/lib/elasticsearch/backups.

I tried to restore the content of a snapshot I took from kibana and restore it on another cluster. It showed that the restoration was succesful but some shards are not found.

Note:

1. The backup directory on the 3 nodes is not NFS, each node has its separate directory
2. The size of backup directory (/var/lib/elasticsearch/backups) is not the same accross the 3 nodes although they have the same no. of shards and same size of data

I'm not sure why is this happening. When I take a snapshot from kibana it shows that the snapshot was successful.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [May 8, 2023, 12:31pm UTC](https://discuss.elastic.co/t/backup-of-elasticsearch/332816/2 "2023-05-08T12:31:10Z")

</div>

> [@raw](#):
>
> The backup directory on the 3 nodes is not NFS, each node has its separate directory

That is not supported. Shared storage available to all master and data nodes is required in order to take a snapshot. Please see [the docs](https://www.elastic.co/guide/en/elasticsearch/reference/8.7/snapshots-filesystem-repository.html) for further details.

---

<div class="post-metadata">

**Author:** ![raw](https://avatars.discourse-cdn.com/v4/letter/r/6bbea6/32.png) [@raw](https://discuss.elastic.co/u/raw)\
**Post date:** [May 8, 2023, 12:42pm UTC](https://discuss.elastic.co/t/backup-of-elasticsearch/332816/3 "2023-05-08T12:42:52Z")

</div>

Do you mean it has to be NFS?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [May 8, 2023, 12:50pm UTC](https://discuss.elastic.co/t/backup-of-elasticsearch/332816/4 "2023-05-08T12:50:17Z")

</div>

Yes, it has to be shared storage, e.g. NFS. There may be other types of shared storage that may work as well.

---

<div class="post-metadata">

**Author:** ![raw](https://avatars.discourse-cdn.com/v4/letter/r/6bbea6/32.png) [@raw](https://discuss.elastic.co/u/raw)\
**Post date:** [May 15, 2023, 10:25am UTC](https://discuss.elastic.co/t/backup-of-elasticsearch/332816/5 "2023-05-15T10:25:19Z")

</div>

Ok. I have setup the backup directory to be managed through NFS. I took a backup from the production cluster and it didn't display any errors.

I have on the production cluster 60 indices and total of 198 shards. The backup was taken to only 50 indices and 98 shards. I don't understand why did that happen. Is it because ES does not backup replicas?

Also, I tried restoring the backup on a testing cluster and most of the indices had a red health state + some other indices don't have data in them.

Note: the size of the directory of /var/lib/elasticsearch is 22GB on each node. The size of the backup directory after single snapshot is 31GB

I don't know what am I doing wrong. Do I need to disable shard allocation before backing up?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 12, 2023, 10:27am UTC](https://discuss.elastic.co/t/backup-of-elasticsearch/332816/7 "2023-06-12T10:27:09Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
