Configuring access to Object Storage from a Elasticsearch cluster
Warning
Yandex Managed Service for Elasticsearch is unavailable as of April 11, 2024.
You can create an OpenSearch cluster in Yandex Cloud as an alternative to Elasticsearch.
Managed Service for Elasticsearch supports using Yandex Object Storage as an Elasticsearch snapshot repository. This allows you to use Object Storage for:
-
Migrating data from a third-party Elasticsearch cluster to Managed Service for Elasticsearch.
-
Adding user extensions.
For more information about snapshots, see the Elasticsearch documentation
To access Object Storage bucket data from a cluster:
Connecting a service account to a cluster
-
When creating or updating a cluster, either select an existing service account or create a new one.
-
Make sure to assign the
storage.editor
role or higher to this account.
Setting up access rights
- In the management console
, select the folder containing the bucket you need. If there is no such bucket, create one. - Select Object Storage.
- Select the Buckets tab.
- Set up the bucket ACL:
- In the Select a user drop-down list, specify the service account connected to the cluster.
- Select the
READ and WRITE
permissions for the selected service account. - Click Add.
- Click Save.
Connecting a snapshot repository
Alert
If a bucket is registered in an Elasticsearch cluster as a snapshot repository, do not edit the bucket contents manually as this will disrupt the Elasticsearch snapshot mechanism.
-
Connect to the cluster.
-
Install the repository-s3 plugin:
sudo bin/elasticsearch-plugin install repository-s3
-
Register the bucket as a snapshot repository using the public Elasticsearch API
:PUT --cacert ~/.elasticsearch/root.crt https://admin:<password>@<host_FQDN>:9200/_snapshot/<repository>
In the request parameters, specify the bucket associated with the cluster service account:
curl --request PUT \ "https://admin:<password>@<host_FQDN>:9200/_snapshot/<repository>" \ --cacert ~/.elasticsearch/root.crt \ --header "Content-Type: application/json" \ --data '{ "type": "s3", "settings": { "endpoint": "storage.yandexcloud.net", "bucket": "<bucket_name>", "base_path": "<path_to_snapshot_directory>", "canned_acl": "bucket-owner-full-control" } }'
To learn more about managing repositories, see the Elasticsearch documentation
.