Hello there!
I will start by providing as many details as possible.
First of all, I want to state that it is my first time working with Elastic and I do not know a lot.
Now, in a company we have 3 EC2 instances, on which they are running Elasticsearch cluster, Elasticsearch is deployed as a docker container, and they need to create a backup for this Elasticsearch, here are the steps I have already done after googling up how to create a backup to s3 when Elasticsearch is running as a docker container, I created s3 bucket and installed s3 plugin using the following command:
docker exec -it <container_id> bin/elasticsearch-plugin install repository-s3
I verified that the plugin is installed, after that I provided access and secret keys using the following commands:
docker exec -it <container_id> bin/elasticsearch-keystore add s3.client.default.access_key
docker exec -it <container_id> bin/elasticsearch-keystore add s3.client.default.secret_key
the list shows that they are added, i made sure that this user has the required permissions and that credentials are new and updated, now here is the tricky part the following command returns with an error:
docker exec -it elasticsearch curl -u elastic: password" -X PUT "localhost:9200/_snapshot/my_s3_repository" -H "Content-Type: application/json" -d '{
"type": "s3",
"settings": {
"bucket": ""bucketname"",
"region": "region-name"
}
}
it returns:
{"error":{"root_cause":[{"type":"repository_exception","reason":"[my_s3_repository] Could not determine repository generation from root blobs"}],"type":"repository_exception","reason":"[my_s3_repository] Could not determine
repository generation from root blobs","caused_by":{"type":"i_o_exception","reason":"Exception when listing blobs by prefix [index-]","caused_by":{"type":"amazon_service_exception","reason":"amazon_service_exception: Unauthorized (Service: null; Status Code: 401; Error Code: null; Request ID: null)"}}},"status":500}
I am not able to understand how to resolve it, I also tried to check the connection with the next command:
aws s3 ls s3://mybucket--region test-region
I installed and configured AWS CLI inside the container, provided the same access and secret key and was able to ls and see the files in the bucket.
I am struggling to understand what step I am missing.
Please advise.
Thank you all in advance!