Click here to Skip to main content
15,881,600 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I snapshot all my indexes on 2019-01-01 snapshot name: S1

Then, I snapshot all my indexes on 2019-01-02 snapshot name: S2, since there is nothing changed on 2019-01-02, so i assume S2 contains no record.

If i remove S1 via elasticsearch api, so i think i cannot restore my data from S2.

is my assumption correct?

so if i have a back up plan, which back up my data every day. I cannot lose any of these back up files, otherwise i can restore my data up to date.

is that correct?

What I have tried:

how is the best way to make the back up plan?
Posted
Updated 29-May-19 21:55pm
v3
Comments
Richard MacCutchan 30-May-19 3:56am    
"[Please delete this question]"
Please do not replace the question title with a request for it to be deleted. This is a public forum and questions, and their answers, are kept here, so they may be of help to other developers who may have similar issues.

On Snapshot and Restore | Elasticsearch Reference[^] is clearly stated:
The index snapshot process is incremental.
It means that, yes, you need previous snapshots to be able to restore indices, since what is saved in the snapshot is only what have changed since last snapshot.
 
Share this answer
 
Comments
855 29-May-19 4:57am    
what is the best way to schedule back up plan. keep all the back up files and never clear up?
phil.o 29-May-19 5:09am    
Having read the article I mentioned in the link, I don't think you have much choice, anyway.
You can delete older snapshots to free up your space as well as decreasing number of snapshots that may cause performance issues and increasing amount of RAM usage for master node to handle large number of snapshots.
You can delete snapshots manually by delete snapshot API:

Delete snapshot API | Elasticsearch Guide [8.2] | Elastic[^]

Also you can use retention configuration of Elasticsearch SLM tool to delete older snapshots taken by SLM, when number of snapshots or age of snapshots exceed your defined threshold:

Create a snapshot | Elasticsearch Guide [8.2] | Elastic[^]

and

Create or update snapshot lifecycle policy API | Elasticsearch Guide [8.2] | Elastic[^]

These deletions of older snapshots do not affect restore process of newer snapshots. Because, when you delete a snapshot (manually or by SLM retention), only those segments that are kept in that snapshot will be deleted and other segments that are pointed by another snapshots remain. Refer to the Elasticsearch Documentation:
"Each snapshot is also logically independent. When you delete a snapshot, Elasticsearch only deletes the segments used exclusively by that snapshot. Elasticsearch doesn’t delete segments used by other snapshots in the repository."

Reference:
Snapshot and restore | Elasticsearch Guide [8.2] | Elastic[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900