Search code examples
elasticsearchelasticsearch-6

unable to backup elastic search data?


Hi I am having an elastic search (version 6.6.0) running on a machine . It has some indexes .

curl -X GET "10.10.9.1:9200/_cat/indices/mep-reports*?v&s=index&pretty"
health status index                  uuid                   pri rep docs.count docs.deleted store.size pri.store.size
yellow open   mep-reports-2019.09.11 l6iFm9fSTp6Q07Qa8BsB-w   1   1     149002         1065     13.6mb         13.6mb
yellow open   mep-reports-2019.09.13 lX3twLgnThKUcOoF3B1vbw   1   1      80079         3870     10.1mb         10.1mb
yellow open   mep-reports-2019.09.18 NzHFBXIASIifRpmlrWQmmg   1   1     283066          164     25.9mb         25.9mb
yellow open   mep-reports-2019.09.20 UB3uCEouSAOAsy96AVz__g   1   1      22002            2      1.8mb          1.8mb
yellow open   mep-reports-2019.09.23 VXI7K7SFS-Ol_FoHinuY3A   1   1     269836         2632     19.8mb         19.8mb
yellow open   mep-reports-2019.09.25 yd6PUSA2Snug-1BAUZICzw   1   1     200001         1972     13.5mb         13.5mb
yellow open   mep-reports-2019.10.01 ji0BqsTQRmm-rIKCd2pg_Q   1   1       5000          790      467kb          467kb
yellow open   mep-reports-2019.10.10 rt3kb2VFTH6XLiqrIvpEow   1   1       5000          790    450.6kb        450.6kb
yellow open   mep-reports-2019.10.17 ws3zILaySwu69U16dKSQlw   1   1         27            9     24.4kb         24.4kb
yellow open   mep-reports-2019.10.24 iKc8ruqWTBCsYz83k6NpHg   1   1       2500          540    276.8kb        276.8kb
       close  mep-reports-2019.10.30 Qrq98yUeS_yvCwzDoQHb3A                                                          
yellow open   mep-reports-2020.02.10 upBGvHxnTdaxHP52N8fEPg   1   1      56000         3260      5.3mb          5.3mb
yellow open   mep-reports-2020.02.11 GfTOrlHBSJKKToHh3u4jnQ   1   1        500            0     43.4kb         43.4kb

I would like to take a data backup and populate that in my local elastic search instance. for that i have tried the following

curl -X PUT "10.10.9.1:9200/_snapshot/my_backup?pretty" -H 'Content-Type: application/json' -d'
{
  "type": "fs",
  "settings": {
    "location": "/tmp/es-backup"
  }
}'

it then returns

{
  "acknowledged" : true
}

how ever when i tries to list the back up folder it is empty .

ls -ltra /tmp/es-backup
total 4
drwxrwxrwt 1 root root 4096 Feb 12 11:11 ..
drwxrwxr-x 2 omn  omn     6 Feb 12 11:46 .

really appreciate any help

thank you


Solution

  • Try to use elasticdump to transfer data from one elastic to another.

    You can also output your data into a .json file.

    A working example:

    Export your indices (data) from a remote elastic server to a .json file.

    elasticdump --input=http://10.10.9.1:9200 --output=data.json --type=data
    

    Import data.json (located in your local machine) to your local elastic server.

    elasticdump --input=data.json --output=http://localhost:9200 --type=data
    

    Try it.

    Hope this helps