Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I verify that the snapshot is ongoing for a particular index in elastic search?

I have a business need to drop and re-create indices with new mappings. I have been doing that successfully until I encountered the following problem:

Cannot delete indices that are being snapshotted. Try again after snapshot finishes or cancel the currently running snapshot.

  1. How do I check if the snapshot is ongoing?
  2. How do I cancel the currently running snapshot?

Is there a Java API for it? I am using version 6.01.

like image 343
Ihor M. Avatar asked Mar 03 '23 00:03

Ihor M.


1 Answers

  1. Get all running snapshots using GET /_snapshot/_status

  2. Deletion of a running snapshot will stop and then delete the snapshot: DELETE /_snapshot/my_repository/snapshot_to_stop

Source: snapshot api

There is no offical java api supporting rhe snapshot and restore module but you can easily issue a http call using the official http rest client

like image 100
ibexit Avatar answered Mar 05 '23 15:03

ibexit