deepsing
(DEEPAK SINGLA)
August 22, 2018, 7:54am
1
Trying to restore elastic search backup from 2.3.0 to 5.6.0
Following the below steps:
update elasticsearch.yml file.
Added path.repo: ["C:/backup_elasticsearch_2_3_0"]
Run below command for backup from the postman
a. PUT localhost:9200/_snapshot/eventindexbackup
{ "type": "fs", "settings": { "location": "eventindex", "compress": "true" } }
b. PUT localhost:9200/_snapshot/eventindexbackup/22aug18
{ "indices": "event*", "ignore_unavailable": true, "include_global_state": false }
c. To check, snapshot is created or not:
GET localhost:9200/_snapshot/eventindexbackup/22aug18
Stop the elastic search.
Download the elastic search 5.6.0
updated elasticsearch.yml file.
Added path.repo: ["C:/backup_elasticsearch_2_3_0"]
started it.
run this query from the postman
POST localhost:9200/_snapshot/eventindexbackup/22aug18/_restore
I am getting below error:
{
"error": {
"root_cause": [
{
"type": "repository_missing_exception",
"reason": "[eventindexbackup] missing"
}
],
"type": "repository_missing_exception",
"reason": "[eventindexbackup] missing"
},
"status": 404`enter code here`
}
Do I need to create the snapshot in 5.6.0 elastic search? Am I following the wrong steps? Please provide me the correct steps.
abdon
(Abdon Pijpelink)
August 22, 2018, 8:06am
2
You need to execute step 2a again on your 5.6 cluster, to register your repository with your new Elasticsearch 5.6 cluster.
deepsing
(DEEPAK SINGLA)
August 22, 2018, 8:09am
3
I also did, but I am still getting
{
"error": {
"root_cause": [
{
"type": "snapshot_restore_exception",
"reason": "[eventindexbackup:22aug18]snapshot does not exist"
}
],
"type": "snapshot_restore_exception",
"reason": "[eventindexbackup:22aug18]snapshot does not exist"
},
"status": 500
}
abdon
(Abdon Pijpelink)
August 22, 2018, 8:13am
4
What is the output of:
GET /_snapshot/eventindexbackup/_all
Does it list the 22aug18
snapshot? If it does, what is the output of:
GET /_snapshot/eventindexbackup/22aug18/_status
deepsing
(DEEPAK SINGLA)
August 22, 2018, 8:19am
5
When I execute this command "localhost:9200/_snapshot/eventindexbackup/_all" for elastic search 2.3.0
I got result:
{
"snapshots": [
{
"snapshot": "22aug18",
"version_id": 2020199,
"version": "2.2.1",
"indices": [
"event-2018.08.21"
],
"state": "SUCCESS",
"start_time": "2018-08-22T07:19:41.496Z",
"start_time_in_millis": 1534922381496,
"end_time": "2018-08-22T07:19:41.673Z",
"end_time_in_millis": 1534922381673,
"duration_in_millis": 177,
"failures": [],
"shards": {
"total": 5,
"failed": 0,
"successful": 5
}
}
]
}
but for elastic search 5.6.0:
{
"snapshots": []
}
abdon
(Abdon Pijpelink)
August 22, 2018, 8:40am
6
I have tried to reproduce your issue, but everything works fine on my machine. Can you try registering your repository as read-only on your 5.6 cluster? The docs state that: "The snapshot format can change across major versions, so if you have clusters on different major versions trying to write the same repository, new snapshots written by one version will not be visible to the other. "
PUT _snapshot/eventindexbackup
{
"type": "fs",
"settings": {
"location": "eventindex",
"compress": "true",
"readonly": true
}
}
And next try to see if the snapshot shows up:
GET /_snapshot/eventindexbackup/_all
deepsing
(DEEPAK SINGLA)
August 22, 2018, 8:47am
7
I executed below command for Elasticsearch 5.6.0
PUT localhost:9200/_snapshot/eventindexbackup
{
"type": "fs",
"settings": {
"location": "eventindex",
"compress": "true",
"readonly": true
}
}
Then I tried
GET /_snapshot/eventindexbackup/_all
I got the same response:
{
"snapshots": []
}
abdon
(Abdon Pijpelink)
August 22, 2018, 8:54am
8
I'm not sure what's going on here.
Can you double check that you have no typo in your 5.6 elasticsearch.yml
file for the path.repo
setting?
What files do you see in the C:\backup_elasticsearch_2_3_0\eventindex
directory?
dir C:\backup_elasticsearch_2_3_0\eventindex
deepsing
(DEEPAK SINGLA)
August 22, 2018, 9:21am
9
Thanks, Abdon
I am able to resolve it.
I was using
path.repo: ["C:/backup_elasticsearch_2_3_0"]
but when I used
path.repo: ["C:\\backup_elasticsearch_2_3_0"]
It is working fine.
But I noticed that indices is restored in elasticsearch 5.6.0 with some dummy name instead of "event-YYYY.MM.DD"
deepsing
(DEEPAK SINGLA)
August 22, 2018, 3:19pm
10
Hi @abdon
I was taking the backup indices from AWS elasticSearch to S3 bucket.
With the help of below link, I am successfully able to take the back
As detailed in our documentation, you can use the Elasticsearch API actions in Amazon Elasticsearch Service to take manual snapshots of your domain. You can easily back up your entire domain this way. However, did you know you can also snapshot and...
But I noticed that name of indices folder has changed on s3 bucket. It is some random name, instead of event-2018.08.21 .
Can you please help to resolve it.
abdon
(Abdon Pijpelink)
August 22, 2018, 3:46pm
11
Maybe you can share the exact request that you're sending to Elasticsearch 5.6 to restore the index?
What is the name of the restored index in 5.6?
deepsing
(DEEPAK SINGLA)
August 22, 2018, 3:56pm
12
I am using below command for backup
a. PUT localhost:9200/_snapshot/es-s3-repository
{
"type": "s3",
"settings": {
"bucket": "es-s3-repository",
"region": "us-west-2",
"role_arn": "arn:aws:iam::123456789012:role/es-s3-repository"
}
}
b. PUT localhost:9200/_snapshot/es-s3-repository/snapshot_1
{
"indices": "event-*",
"ignore_unavailable": true,
"include_global_state": false
}
you will get more information from here:
abdon
(Abdon Pijpelink)
August 22, 2018, 4:26pm
13
The directory names do not correspond to index names. What happens if you restore these indices into your target cluster? The indexes should keep their original names then.
deepsing
(DEEPAK SINGLA)
August 23, 2018, 1:20pm
14
Hi @abdon
When I restored these indices into target, they stored with their original name.
system
(system)
Closed
September 20, 2018, 1:27pm
15
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.