ElasticSearch snapshot/backup doesn't work


(sandeep) #1

Hi all, i am trained on elasticsearch, my questiuon is, My ES snapshot doesn’t work or looks empty.

First, I have done this on my Ubuntu server:

1.create a directory for backups

mkdir /home/admin/dumps/elasticsearch

2.set this directory to elastissearch.yml for snapshots

path.repo: ["/home/admin/dumps/elasticsearch"]

3.setup the snapshot repository location

curl -XPUT 'http://localhost:9200/_snapshot/backup' -d '{
  "type": "fs",
  "settings": {
    "location": "/home/admin/dumps/elasticsearch",
    "compress": true
  }
}'

Then, I can run a snapshot:

curl -XPUT localhost:9200/_snapshot/backup/elasticsearch_snapshot?wait_for_completion=true

Response:
{“snapshot”:{“snapshot”:“elasticsearch_snapshot”,“version_id”:2030099,“version”:“2.3.0”,“indices”:[“references”],“state”:“SUCCESS”,“start_time”:“2016-04-08T08:45:30.525Z”,“start_time_in_millis”:1460105130525,“end_time”:“2016-04-08T08:45:30.779Z”,“end_time_in_millis”:1460105130779,“duration_in_millis”:254,“failures”:[],“shards”:{“total”:15,“failed”:0,“successful”:15}}}
I also created a cronjob to backup ElasticSearch at 5:35 each day:

35 5 * * * curl -X PUT "localhost:9200/_snapshot/backup/elasticsearch.$(date +\%Y-\%m-\%d)?wait_for_completion=true"

Well, when I go to my dumps/elasticsearch folder, I got that:

-rw-r–r-- 1 elasticsearch elasticsearch 256 Apr 8 10:45 index drwxr-xr-x 5 elasticsearch elasticsearch 4096 Apr 8 05:35 indices -rw-r–r-- 1 elasticsearch elasticsearch 121 Apr 1 05:35 meta-elasticsearch.2016-04-01.dat -rw-r–r-- 1 elasticsearch elasticsearch 121 Apr 2 05:35 meta-elasticsearch.2016-04-02.dat -rw-r–r-- 1 elasticsearch elasticsearch 121 Apr 3 05:35 meta-elasticsearch.2016-04-03.dat -rw-r–r-- 1 elasticsearch elasticsearch 121 Apr 4 05:35 meta-elasticsearch.2016-04-04.dat -rw-r–r-- 1 elasticsearch elasticsearch 121 Apr 5 05:35 meta-elasticsearch.2016-04-05.dat -rw-r–r-- 1 elasticsearch elasticsearch 121 Apr 6 05:35 meta-elasticsearch.2016-04-06.dat -rw-r–r-- 1 elasticsearch elasticsearch 121 Apr 7 05:35 meta-elasticsearch.2016-04-07.dat -rw-r–r-- 1 elasticsearch elasticsearch 121 Apr 8 05:35 meta-elasticsearch.2016-04-08.dat -rw-r–r-- 1 elasticsearch elasticsearch 213 Apr 1 05:35 snap-elasticsearch.2016-04-01.dat -rw-r–r-- 1 elasticsearch elasticsearch 213 Apr 2 05:35 snap-elasticsearch.2016-04-02.dat -rw-r–r-- 1 elasticsearch elasticsearch 213 Apr 3 05:35 snap-elasticsearch.2016-04-03.dat -rw-r–r-- 1 elasticsearch elasticsearch 212 Apr 4 05:35 snap-elasticsearch.2016-04-04.dat -rw-r–r-- 1 elasticsearch elasticsearch 213 Apr 5 05:35 snap-elasticsearch.2016-04-05.dat -rw-r–r-- 1 elasticsearch elasticsearch 213 Apr 6 05:35 snap-elasticsearch.2016-04-06.dat -rw-r–r-- 1 elasticsearch elasticsearch 213 Apr 7 05:35 snap-elasticsearch.2016-04-07.dat -rw-r–r-- 1 elasticsearch elasticsearch 217 Apr 8 05:35 snap-elasticsearch.2016-04-08.dat

Cron snapshots are there but all data seems empty ! What did I miss ?
Thankyou,
sandeep
Elastic search Developer


(Simone Scarduzio) #2

Hi @sandeepkumar,
Can you confirm that if you remove ReadonlyREST plugin the above works?