wiki:elasticsearch_commands
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
wiki:elasticsearch_commands [2022/12/06 15:13] – antisa | wiki:elasticsearch_commands [2023/01/11 16:03] (current) – [Restore snapshot] add restore single index antisa | ||
---|---|---|---|
Line 12: | Line 12: | ||
Replace " | Replace " | ||
+ | ==== Delete all indices ==== | ||
+ | |||
+ | curl -X DELETE ' | ||
===== Create snapshot ===== | ===== Create snapshot ===== | ||
Register repo first: | Register repo first: | ||
Line 30: | Line 33: | ||
curl -X PUT " | curl -X PUT " | ||
+ | |||
+ | <WRAP center round tip 60%> | ||
+ | To create single index snapshot use | ||
+ | < | ||
+ | curl -X PUT " | ||
+ | { | ||
+ | " | ||
+ | }' | ||
+ | </ | ||
+ | </ | ||
The backup folder is created in /// | The backup folder is created in /// | ||
Line 45: | Line 58: | ||
tar xvf / | tar xvf / | ||
- | When you transfer it to another server unzip it, make sure that the owner is elasticsearch on the folder and then create the snapshot repository with command above, otherwise you won't see when trying to list the snaphots. | + | When you transfer it to another server unzip it, make sure that the owner is elasticsearch on the folder and then create the snapshot repository with command above, otherwise you won't see it when trying to list the snaphots. |
+ | |||
+ | List the snapshots with above command. | ||
After this do the restore with snapshot name you want: | After this do the restore with snapshot name you want: | ||
curl -s -X POST " | curl -s -X POST " | ||
+ | |||
+ | <WRAP center round tip 60%> | ||
+ | To restore single index use | ||
+ | < | ||
+ | curl -s -X POST " | ||
+ | { | ||
+ | " | ||
+ | }' | ||
+ | </ | ||
+ | </ | ||
If you get an [[https:// | If you get an [[https:// | ||
- | curl -s -X POST " | + | curl -s -X POST " |
- | { | + | |
" | " | ||
- | } | + | }' |
==== Tested on ==== | ==== Tested on ==== | ||
Line 66: | Line 91: | ||
====== References ====== | ====== References ====== | ||
* https:// | * https:// | ||
+ | * https:// | ||
+ | |||
wiki/elasticsearch_commands.1670339628.txt.gz · Last modified: 2022/12/06 15:13 by antisa