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.
Getting a list of installed plugins
- In the management console
, navigate to the folder page. - Navigate to the Managed Service for OpenSearch service.
- Click the name of your cluster.
If you do not have the Yandex Cloud CLI installed yet, install and initialize it.
By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.
To get a list of installed plugins, get information about your 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 get the cluster name and ID with the list of clusters in the folder.
-
Get an IAM token for API authentication and put it in an environment variable:
export IAM_TOKEN="<IAM_token>" -
Call the Cluster.Get method, e.g., via the following cURL
request: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 the list of clusters in the folder.
-
Check the server response to make sure your request was successful.
You will see enabled plugins on the
config.opensearch.pluginslist.
-
Get an IAM token for API authentication and put it in an environment variable:
export IAM_TOKEN="<IAM_token>" -
Clone the cloudapi
repository:cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapiBelow, we assume that the repository contents reside in the
~/cloudapi/directory. -
Call the ClusterService.Get method, e.g., via the following gRPCurl
request: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.GetYou can get the cluster ID with the list of clusters in the folder.
-
Check the server response to make sure your request was successful.
You will see enabled plugins on the
config.opensearch.pluginslist.
Editing a list of installed plugins
- In the management console
, navigate to the folder page. - Navigate to the Managed Service for OpenSearch service.
- Select the cluster and click
Edit in the top panel. - Under Basic parameters, specify the plugins to install.
- Click Save.
If you do not have the Yandex Cloud CLI installed yet, install and initialize it.
By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.
To edit a list of installed OpenSearch plugins, run this 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 get the cluster name and ID with the list of clusters in the folder.
-
Open the current Terraform configuration file describing your infrastructure.
To learn how to create this file, see Creating a cluster.
For a complete list of adjustable configuration fields for a Managed Service for OpenSearch cluster, see the Terraform provider guide.
-
In the cluster description, edit the list of clusters for the
pluginsparameter 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.
-
In the command line, navigate to the directory that contains the current Terraform configuration files defining the infrastructure.
-
Run this command:
terraform validateTerraform will show any errors found in your configuration files.
-
-
Confirm updating the resources.
-
Run this command to view the planned changes:
terraform planIf you described the configuration correctly, the terminal will display a list of the resources to update and their parameters. This is a verification step that does not apply changes to your resources.
-
If everything looks correct, apply the changes:
-
Run this command:
terraform apply -
Confirm updating the resources.
-
Wait for the operation to complete.
-
-
-
Get an IAM token for API authentication and put it in an environment variable:
export IAM_TOKEN="<IAM_token>" -
Use the Cluster.Update method and send the following 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
updateMaskparameter 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_plugin_1>", "<OpenSearch_plugin_2>", ... "<OpenSearch_plugin_N>" ] } } }'Where:
-
updateMask: Comma-separated string of settings you want to update.Here, we provide only one setting.
-
configSpec.opensearchSpec.plugins: New list of OpenSearch plugins.
You can get the cluster ID with the list of clusters in the folder.
-
-
Check the server response to make sure your request was successful.
-
Get an IAM token for API authentication and put it in an environment variable:
export IAM_TOKEN="<IAM_token>" -
Clone the cloudapi
repository:cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapiBelow, we assume that the repository contents reside in the
~/cloudapi/directory. -
Use the ClusterService.Update call and send the following 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_maskparameter 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_plugin_1>", "<OpenSearch_plugin_2>", ... "<OpenSearch_plugin_N>" ] } } }' \ mdb.api.cloud.yandex.net:443 \ yandex.cloud.mdb.opensearch.v1.ClusterService.UpdateWhere:
-
update_mask: List of parameters to update as an array of strings (paths[]).Here, we provide only one setting.
-
config_spec.opensearch_spec.plugins: New list of OpenSearch plugins.
You can get the cluster ID with the list of clusters in the folder.
-
-
Check the server response to make sure your request was successful.