Configuring access to Object Storage from an OpenSearch cluster
Managed Service for OpenSearch supports using Yandex Object Storage as an OpenSearch snapshot repository. This allows you to use Object Storage to store backups. For more information about snapshot repositories, see the OpenSearch documentation
To access Object Storage bucket data from a cluster:
- Connect the service account to the cluster.
- Configure access permissions.
- Connect a snapshot repository.
Before you begin, make sure your Yandex Cloud account has the iam.serviceAccounts.user role or higher. You will need this role in the following cases:
- To create or modify a cluster and link it to a service account.
- To restore a cluster linked to a service account from its backup.
Connect the service account to the cluster
-
When creating or updating a cluster, either select an existing service account or create a new one.
-
Make sure this account has the
storage.editor
role.
Configure access permissions
-
In the management console
, select the folder with the appropriate bucket. 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 and Save.
Connect a snapshot repository
Alert
If a bucket is registered in an OpenSearch cluster as a snapshot repository, do not edit the bucket contents manually as this will disrupt the OpenSearch snapshot mechanism.
-
Install the
repository-s3
plugin. -
Connect to the cluster.
-
Register the bucket as a snapshot repository using the public OpenSearch API
:PUT --cacert ~/.opensearch/root.crt https://admin:<password>@<ID_of_OpenSearch_host_with_DATA_role>.mdb.yandexcloud.net:9200/_snapshot/<repository_name>
In the request parameters, specify the bucket associated with the cluster service account:
curl --request PUT \ "https://admin:<password>@<ID_of_OpenSearch_host_with_DATA_role>.mdb.yandexcloud.net:9200/_snapshot/<repository_name>" \ --cacert ~/.opensearch/root.crt \ --header "Content-Type: application/json" \ --data '{ "type": "s3", "settings": { "endpoint": "storage.yandexcloud.net", "bucket": "<bucket_name>" } }'