I am trying to create snapshots of my ealsticsearch in s3 bucket. i had created an s3 bucket with public access and created an user with the following permission
{
"Statement": [
{
"Action": [
"s3:ListBucket",
"s3:GetBucketLocation",
"s3:ListBucketMultipartUploads",
"s3:ListBucketVersions"
],
"Effect": "Allow",
"Resource": [
"arn:aws:s3:::elastic-snapshots"
]
},
{
"Action": [
"s3:GetObject",
"s3:PutObject",
"s3:AbortMultipartUpload",
"s3:ListMultipartUploadParts"
],
"Effect": "Allow",
"Resource": [
"arn:aws:s3:::elastic-snapshots",
"arn:aws:s3:::elastic-snapshots/*"
]
}
],
"Version": "2012-10-17"
}
after that installed s3 repository plugin by using this
sudo bin/elasticsearch-plugin install repository-s3
and added secret-key and access key by following commands
bin/elasticsearch-keystore add s3.client.default.access_key
bin/elasticsearch-keystore add s3.client.default.secret_key
and tried to create snapshot_repository with following command
curl -X PUT "10.0.0.198:9200/_snapshot/snapshot_repository?pretty" -H 'Content-Type: application/json' -d'{ "type": "s3", "settings": { "region": "us-west-1",
"bucket": "elastic-snapshots", "base_path": "/snapshot-repository/",
"endpoint": "s3-us-west-1.amazon.aws.com" } }'
it is giving me the following exception
"error" : {
"root_cause" : [
{
"type" : "repository_verification_exception",
"reason" : "[snapshot_repository] path [/snapshot-repository/] is not accessible on master node"
}
],
"type" : "repository_verification_exception",
"reason" : "[snapshot_repository] path [/snapshot-repository/] is not accessible on master node",
"caused_by" : {
"type" : "i_o_exception",
"reason" : "Unable to upload object [/snapshot-repository//tests-72t6ssc0TC2oQXObyby9yQ/master.dat] using a single upload",
"caused_by" : {
"type" : "sdk_client_exception",
"reason" : "sdk_client_exception: The requested metadata is not found at http://169.254.169.254/latest/meta-data/iam/security-credentials/"
}
}
},
"status" : 500
}
any help would be appreciated. i'm literally struck here.