Managing OpenSearch plugins
When creating a cluster in Managed Service for OpenSearch, you can specify a list of required plugins and they will be installed in the cluster automatically. For a full list of available plugins, see Additional plugins.
Retrieving a list of installed plugins
- In the management console
, go to the folder page and select Managed Service for OpenSearch. - Click the cluster name.
If you do not have the Yandex Cloud command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
To get a list of installed plugins, request information about an OpenSearch cluster:
yc managed-opensearch cluster get <cluster_name_or_ID>
You can find a list of plugins in the config.opensearch.plugins
parameter.
You can request the cluster name and ID with the list of clusters in the folder.
-
Get an IAM token for API authentication and put it into the environment variable:
export IAM_TOKEN="<IAM_token>"
-
Use the Cluster.Get method and make a request, e.g., via cURL
:curl \ --request GET \ --header "Authorization: Bearer $IAM_TOKEN" \ --url 'https://mdb.api.cloud.yandex.net/managed-opensearch/v1/clusters/<cluster_ID>'
You can get the cluster ID with a list of clusters in the folder.
-
View the server response to make sure the request was successful.
Enabled plugins will be on the
config.opensearch.plugins
list.
-
Get an IAM token for API authentication and put it into the environment variable:
export IAM_TOKEN="<IAM_token>"
-
Clone the cloudapi
repository:cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
Below, we assume the repository contents are stored in the
~/cloudapi/
directory. -
Use the ClusterService.Get call and make a request, e.g., via gRPCurl
:grpcurl \ -format json \ -import-path ~/cloudapi/ \ -import-path ~/cloudapi/third_party/googleapis/ \ -proto ~/cloudapi/yandex/cloud/mdb/opensearch/v1/cluster_service.proto \ -rpc-header "Authorization: Bearer $IAM_TOKEN" \ -d '{ "cluster_id": "<cluster_ID>" }' \ mdb.api.cloud.yandex.net:443 \ yandex.cloud.mdb.opensearch.v1.ClusterService.Get
You can get the cluster ID with a list of clusters in the folder.
-
View the server response to make sure the request was successful.
Enabled plugins will be on the
config.opensearch.plugins
list.
Editing a list of installed plugins
- In the management console
, go to the folder page and select Managed Service for OpenSearch. - Select the cluster and click
Edit in the top panel. - Under Basic parameters, specify the plugins you want to install.
- Click Save.
If you do not have the Yandex Cloud command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
To change the list of installed OpenSearch plugins, run the command:
yc managed-opensearch cluster update <cluster_name_or_ID> \
--plugins <plugins>
In the --plugins
parameter, list the required plugins separated by commas. To keep the previously installed plugins, specify them in the --plugins
parameter as well.
You can request the cluster name and ID with the list of clusters in the folder.
-
Open the current Terraform configuration file with an infrastructure plan.
For more information about creating this file, see Creating clusters.
For a complete list of available Managed Service for OpenSearch cluster configuration fields, see the Terraform provider documentation
. -
In the cluster description, change the list of clusters for the
plugins
parameter underconfig
. If there is no such parameter, add it.resource "yandex_mdb_opensearch_cluster" "<cluster_name>" { ... config { plugins = ["<list_of_plugin_names>"] ... } }
-
Make sure the settings are correct.
-
Using the command line, navigate to the folder that contains the up-to-date Terraform configuration files with an infrastructure plan.
-
Run the command:
terraform validate
If there are errors in the configuration files, Terraform will point to them.
-
-
Confirm updating the resources.
-
Run the command to view planned changes:
terraform plan
If the resource configuration descriptions are correct, the terminal will display a list of the resources to modify and their parameters. This is a test step. No resources are updated.
-
If you are happy with the planned changes, apply them:
-
Run the command:
terraform apply
-
Confirm the update of resources.
-
Wait for the operation to complete.
-
-
-
Get an IAM token for API authentication and put it into the environment variable:
export IAM_TOKEN="<IAM_token>"
-
Use the Cluster.Update method and make a request, e.g., via cURL
:Warning
The API method will assign default values to all the parameters of the object you are modifying unless you explicitly provide them in your request. To avoid this, list the settings you want to change in the
updateMask
parameter as a single comma-separated string.curl \ --request PATCH \ --header "Authorization: Bearer $IAM_TOKEN" \ --header "Content-Type: application/json" \ --url 'https://mdb.api.cloud.yandex.net/managed-opensearch/v1/clusters/<cluster_ID>' \ --data '{ "updateMask": "configSpec.opensearchSpec.plugins", "configSpec": { "opensearchSpec": { "plugins": [ "<OpenSearch_pugin_1>", "<OpenSearch_pugin_2>", ... "<OpenSearch_pugin_N>" ] } } }'
Where:
-
updateMask
: List of parameters to update as a single string, separated by commas.Only one parameter is provided in this case.
-
configSpec.opensearchSpec.plugins
: New list of OpenSearch plugins.
You can get the cluster ID with a list of clusters in the folder.
-
-
View the server response to make sure the request was successful.
-
Get an IAM token for API authentication and put it into the environment variable:
export IAM_TOKEN="<IAM_token>"
-
Clone the cloudapi
repository:cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
Below, we assume the repository contents are stored in the
~/cloudapi/
directory. -
Use the ClusterService.Update call and make a request, e.g., via gRPCurl
:Warning
The API method will assign default values to all the parameters of the object you are modifying unless you explicitly provide them in your request. To avoid this, list the settings you want to change in the
update_mask
parameter as an array ofpaths[]
strings.Format for listing settings
"update_mask": { "paths": [ "<setting_1>", "<setting_2>", ... "<setting_N>" ] }
grpcurl \ -format json \ -import-path ~/cloudapi/ \ -import-path ~/cloudapi/third_party/googleapis/ \ -proto ~/cloudapi/yandex/cloud/mdb/opensearch/v1/cluster_service.proto \ -rpc-header "Authorization: Bearer $IAM_TOKEN" \ -d '{ "cluster_id": "<cluster_ID>", "update_mask": { "paths": [ "config_spec.opensearch_spec.plugins" ] }, "config_spec": { "opensearch_spec": { "plugins": [ "<OpenSearch_pugin_1>", "<OpenSearch_pugin_2>", ... "<OpenSearch_pugin_N>" ] } } }' \ mdb.api.cloud.yandex.net:443 \ yandex.cloud.mdb.opensearch.v1.ClusterService.Update
Where:
-
update_mask
: List of parameters to update as an array ofpaths[]
strings.Only one parameter is provided in this case.
-
config_spec.opensearch_spec.plugins
: New list of OpenSearch plugins.
You can get the cluster ID with a list of clusters in the folder.
-
-
View the server response to make sure the request was successful.