Updating OpenSearch cluster settings
After creating a cluster, you can change:
You can also:
- Update the OpenSearch version.
- Change the host group configuration.
- Move host groups to a different availability zone.
Changing a service account
Warning
If the cluster already uses a service account to access objects from Yandex Object Storage, then changing it to a different service account may make these objects unavailable and interrupt the cluster operation. Before changing the service account settings, make sure that the cluster does not use the objects in question.
- 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. - In the Service account field, select the account you need from the list or create a new one. For more information about setting up service accounts, see Configuring access to Object Storage.
- 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 a service account linked to a Managed Service for OpenSearch cluster, run the command:
yc managed-opensearch cluster update <cluster_name_or_ID> \
--service-account-name <service_account_name>
You can request the cluster name and ID with a list of clusters in the folder.
For more information about setting up service accounts, see Configuring access to Object Storage.
-
Open the current Terraform configuration file with an infrastructure plan.
For a complete list of available Managed Service for OpenSearch cluster configuration fields, see the Terraform provider documentation
. -
In the
service_account_id
field, specify the service account ID:resource "yandex_mdb_opensearch_cluster" "<cluster_name>" { ... service_account_id = "<service_account_ID>" }
For more information about setting up service accounts, see Configuring access to Object Storage.
-
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.
-
-
To change service account settings, use the update REST API method for the Cluster resource or the ClusterService/Update gRPC API call and provide the following in the request:
- Cluster ID in the
clusterId
parameter. To find out the cluster ID, get a list of clusters in the folder. - ID of the service account used for cluster operations in the
serviceAccountId
parameter.
For more information about setting up service accounts, see Configuring access to Object Storage.
Warning
This API method overrides all parameters of the object being modified that were not explicitly passed in the request to the default values. To avoid this, list the settings you want to change in the updateMask
parameter (one line separated by commas).
Changing the admin password
- 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. - In the Admin password field, enter a new password.
- 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 admin
password for a cluster, enter a new password using one of these methods:
-
Entering a password as plain text (less secure method).
yc managed-opensearch cluster update <cluster_name_or_ID> \ --admin-password <new_password>
-
Generating a password automatically. The generated password will be output to the console.
yc managed-opensearch cluster update <cluster_name_or_ID> \ --generate-admin-password
You can request the cluster name and ID with a list of clusters in the folder.
-
Open the current Terraform configuration file with an infrastructure plan.
For a complete list of available Managed Service for OpenSearch cluster configuration fields, see the Terraform provider documentation
. -
In the
config
section, change theadmin_password
field value:resource "yandex_mdb_opensearch_cluster" "<cluster_name>" { ... config { admin_password = "<new_admin_password>" } }
-
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.
-
-
To update the admin
user's password, use the update REST API method for the Cluster resource or the ClusterService/Update gRPC API call and provide the following in the request:
- Cluster ID in the
clusterId
parameter. To find out the cluster ID, get a list of clusters in the folder. - New
admin
user password in theconfigSpec.adminPassword
parameter.
Warning
This API method overrides all parameters of the object being modified that were not explicitly passed in the request to the default values. To avoid this, list the settings you want to change in the updateMask
parameter (one line separated by commas).
Changing OpenSearch settings
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.
Run the following command with a list of settings to change:
yc managed-opensearch cluster update <cluster_name_or_ID> \
--max-clause-count <number_of_boolean_expressions> \
--fielddata-cache-size <JVM_heap_size> \
--reindex-remote-whitelist <host_address>:<port>
You can request the cluster name and ID with a list of clusters in the folder.
Command settings:
--max-clause-count
: Maximum allowed number of boolean expressions per query. See more in the OpenSearch documentation .--fielddata-cache-size
: JVM heap size allocated for the fielddata data structure. You can specify either an absolute value or percentage, e.g.,512mb
or50%
. For more details, see the OpenSearch documentation .--reindex-remote-whitelist
: List of remote hosts whose indexes contain documents to copy for reindexing. Specify the parameter value as<host_address>:<port>
. If you need to specify more than one host, list values separated by commas. For more details, see the OpenSearch documentation .
To change OpenSearch settings, use the update REST API method for the Cluster resource or the ClusterService/Update gRPC API call and provide the following in the request:
- Cluster ID in the
clusterId
parameter. To find out the cluster ID, get a list of clusters in the folder. - New maximum allowed number of boolean expressions in the
configSpec.opensearchSpec.opensearchConfig_2.maxClauseCount
parameter. See more in the OpenSearch documentation . - New JVM heap size allocated for the fielddata data structure in the
configSpec.opensearchSpec.opensearchConfig_2.fielddataCacheSize
parameter. You can specify either an absolute value or percentage, e.g.,512mb
or50%
. For more details, see the OpenSearch documentation . - New list of remote hosts whose indexes contain documents to copy for reindexing in the
configSpec.opensearchSpec.opensearchConfig_2.reindexRemoteWhitelist
parameter. For more details, see the OpenSearch documentation .
Warning
This API method overrides all parameters of the object being modified that were not explicitly passed in the request to the default values. To avoid this, list the settings you want to change in the updateMask
parameter (one line separated by commas).
Changing additional cluster settings
-
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. -
Change additional cluster settings:
-
Maintenance window: Maintenance window settings:
- To enable maintenance at any time, select arbitrary (default).
- To specify the preferred maintenance start time, select by schedule and specify the desired day of the week and UTC hour. For example, you can choose a time when the cluster is least loaded.
Maintenance operations are carried out both on enabled and disabled clusters. They may include updating the DBMS, applying patches, and so on.
-
Deletion protection: Manages protection of the cluster, its databases, and users against accidental deletion.
Cluster deletion protection will not prevent a manual connection to a cluster to delete data.
-
-
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.
Run the following command with a list of settings to change:
yc managed-opensearch cluster update <cluster_name_or_ID> \
--maintenance schedule=<maintenance_type>,`
`weekday=<day_of_week>,`
`hour=<hour_of_day> \
--delete-protection=<true_or_false> \
--data-transfer-access=<true_or_false> \
--serverless-access=<true_or_false>
You can request the cluster name and ID with a list of clusters in the folder.
Command settings:
-
--maintenance
: Maintenance time settings (including for disabled clusters):-
To allow maintenance at any time, specify
--maintenance schedule=anytime
. -
To specify the preferred maintenance start time, specify
--maintenance schedule=weekly,weekday=<day_of_week>,hour=<hour_in_UTC>
. In this case, maintenance will take place every week on a specified day at a specified time.Possible values of the
weekday
parameter:mon
,tue
,wed
,thu
,fry
,sat
, andsun
. In thehour
parameter, specify the maintenance completion time. For example, if you set14
, maintenance will take place from 13:00 until 14:00 UTC.
-
-
--delete-protection
: Cluster protection against accidental deletion by a user,true
orfalse
.Cluster deletion protection will not prevent a manual connection to a cluster to delete data.
-
--serverless-access
: Access from Yandex Serverless Containers,true
orfalse
.
-
Open the current Terraform configuration file with an infrastructure plan.
For a complete list of available Managed Service for OpenSearch cluster configuration fields, see the Terraform provider documentation
. -
To change the maintenance time (including for disabled clusters), specify the following settings in the
maintenance_window
parameter:resource "yandex_mdb_opensearch_cluster" "<cluster_name>" { ... maintenance_window { type = "<maintenance_frequency>" hour = <hour> day = "<day_of_week>" } }
Specify the following in the parameters:
type
:ANYTIME
to allow maintenance at any time orWEEKLY
to perform maintenance every week.hour
: Maintenance completion hour, UTC. For example, if you set14
, maintenance will take place from 13:00 until 14:00 UTC.day
: Day of week for maintenance. Possible values:MON
,TUE
,WED
,THU
,FRI
,SAT
, andSUN
.
-
To enable cluster protection against accidental deletion by a user of your cloud, add the
deletion_protection
field set totrue
to your cluster description:resource "yandex_mdb_opensearch_cluster" "<cluster_name>" { ... deletion_protection = <true_or_false> }
Where
deletion_protection
is cluster deletion protection.Enabled deletion protection will not prevent a manual connection with the purpose to delete database contents.
-
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.
-
-
To update the admin
user's password, use the update REST API method for the Cluster resource or the ClusterService/Update gRPC API call and provide the following in the request:
-
Cluster ID in the
clusterId
parameter. To find out the cluster ID, get a list of clusters in the folder. -
Maintenance window settings (including for disabled clusters) in the
maintenanceWindow
parameter. -
Cluster deletion protection settings in the
deletionProtection
parameter.Enabled deletion protection will not prevent a manual connection with the purpose to delete database contents.
-
Settings for access from Yandex Data Transfer in the
configSpec.access.dataTransfer
parameter. -
Settings for access from Yandex Serverless Containers in the
configSpec.access.serverless
parameter.
Warning
This API method overrides all parameters of the object being modified that were not explicitly passed in the request to the default values. To avoid this, list the settings you want to change in the updateMask
parameter (one line separated by commas).
Changing security groups
After you assign other security groups, you may need to additionally set them up to connect to the cluster.
- 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 Network settings, select security groups for cluster network traffic.
- 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 edit the list of security groups for a cluster, specify the security groups you need in the command:
yc managed-opensearch cluster update <cluster_name_or_ID> \
--security-group-ids <list_of_security_group_IDs>
If you need to specify more than one group, list them separated by commas.
You can request the cluster name and ID with a list of clusters in the folder.
-
Open the current Terraform configuration file with an infrastructure plan.
For a complete list of available Managed Service for OpenSearch cluster configuration fields, see the Terraform provider documentation
. -
In the
security_group_ids
field, list the security group IDs separated by commas:resource "yandex_mdb_opensearch_cluster" "<cluster_name>" { ... security_group_ids = [ "<security_groups>" ] }
-
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.
-
-
To edit the list of cluster security groups, use the update REST API method for the Cluster resource or the ClusterService/Update gRPC API call and provide the following in the request:
- Cluster ID in the
clusterId
parameter. To find out the cluster ID, get a list of clusters in the folder. - List of security group IDs in the
securityGroupIds
parameter.
Warning
This API method overrides all parameters of the object being modified that were not explicitly passed in the request to the default values. To avoid this, list the settings you want to change in the updateMask
parameter (one line separated by commas).