Updating Elasticsearch cluster settings
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.
After creating a cluster, you can:
- Change service account settings.
- Change the host class.
Increase storage size. - Configure Elasticsearch servers as described in the Elasticsearch documentation
. - Change the admin password.
- Change additional cluster settings.
Learn more about other cluster updates:
- Updating the Elasticsearch version and edition.
- Migrating cluster hosts to a different availability zone.
Changing service account settings
- In the management console
, go to the folder page and select Managed Service for Elasticsearch. - Select a cluster and click
Edit in the top panel. - Select the service account you need from the list or create a new one. For more information about setting up a service account, see Configuring access to Object Storage from a cluster.
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 settings of the service account used to work with the cluster:
-
View the description of the update cluster CLI command:
yc managed-elasticsearch cluster update --help
-
Specify the service account ID in the update cluster command:
yc managed-elasticsearch cluster update <cluster_name_or_ID> \ --service-account-id <service_account_ID>
You can request the cluster name and ID with the list of clusters in the folder.
Managed Service for Elasticsearch will run the service account update for the cluster.
-
Open the current Terraform configuration file with an infrastructure plan.
For more information about creating this file, see Creating clusters.
-
In the
service_account_id
field, enter the service account ID:resource "yandex_mdb_elasticsearch_cluster" "<cluster_name>" { ... service_account_id = <service_account_ID> }
-
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.
-
Time limits
A Terraform provider sets the timeout for Managed Service for Elasticsearch cluster operations:
- Creating a cluster, including by restoring one from a backup: 30 minutes.
- Editing a cluster: 60 minutes.
- Deleting a cluster: 15 minutes.
Operations exceeding the set timeout are interrupted.
How do I change these limits?
Add the
timeouts
block to the cluster description, for example:resource "yandex_mdb_elasticsearch_cluster" "<cluster_name>" { ... timeouts { create = "1h30m" # 1 hour 30 minutes update = "2h" # 2 hours delete = "30m" # 30 minutes } }
-
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.You can get the cluster ID with a list of clusters in the folder.
-
ID of the service account used for cluster operations in the
serviceAccountId
parameter.
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.
Warning
If the cluster already uses a service account to access objects from 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 doesn't use the objects in question.
Changing the host class
- In the management console
, go to the folder page and select Managed Service for Elasticsearch. - Select a cluster and click
Edit in the top panel. - To change the class of Elasticsearch hosts with the Data node role:
- Go to the Data node tab.
- Under Host class , select the class for the host.
- To change the class of Elasticsearch hosts with the Master node role:
- Go to the Master node tab.
- Under Host class , select the class for the host.
- 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 host class for the cluster:
-
View the description of the update cluster CLI command:
yc managed-elasticsearch cluster update --help
-
Specify the host class you need with the Data node and Master node roles in the update cluster command:
yc managed-elasticsearch cluster update <cluster_name_or_ID> \ --datanode-resource-preset <class_of_hosts_with_the_Data_node_role> \ --masternode-resource-preset <class_of_hosts_with_the_Master_node_role>
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 Elasticsearch cluster configuration fields, see the Terraform provider documentation
. -
In the Managed Service for Elasticsearch cluster description, change the
resource_preset_id
attribute value underconfig.data_node.resources
orconfig.master_node.resources
:resource "yandex_mdb_elasticsearch_cluster" "<cluster_name>" { ... config { data_node { resources { resource_preset_id = "<host_class>" ... } } master_node { resources { resource_preset_id = "<host_class>" ... } } } }
-
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.
-
Time limits
A Terraform provider sets the timeout for Managed Service for Elasticsearch cluster operations:
- Creating a cluster, including by restoring one from a backup: 30 minutes.
- Editing a cluster: 60 minutes.
- Deleting a cluster: 15 minutes.
Operations exceeding the set timeout are interrupted.
How do I change these limits?
Add the
timeouts
block to the cluster description, for example:resource "yandex_mdb_elasticsearch_cluster" "<cluster_name>" { ... timeouts { create = "1h30m" # 1 hour 30 minutes update = "2h" # 2 hours delete = "30m" # 30 minutes } }
-
To change the host class, 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.You can get the cluster ID with a list of clusters in the folder.
-
Host class in the following parameters:
configSpec.elasticsearchSpec.dataNode.resources.resourcePresetId
: For hosts with the Data node role.configSpec.elasticsearchSpec.masterNode.resources.resourcePresetId
: For hosts with the Master node role.
To request a list of supported values, use the list method for the
ResourcePreset
resources. -
List of settings to update in the
updateMask
parameter.
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.
Increasing storage size
Make sure the cloud has enough quota to increase the storage size. Open the cloud's Quotas
To increase the cluster storage size:
- In the management console
, go to the folder page and select Managed Service for Elasticsearch. - Select a cluster and click
Edit in the top panel. - To increase the disk size for Elasticsearch hosts with the Data node role:
- Go to the Data node tab.
- Under Storage, specify the disk size.
- To increase the disk size for Elasticsearch hosts with the Master node role:
- Go to the Master node tab.
- Under Storage, specify the disk size.
- 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 increase the cluster storage size:
-
View a description of the CLI update configuration command:
yc managed-elasticsearch cluster update --help
-
Specify new storage settings for hosts with the Data node and Master node roles in the update cluster command:
yc managed-elasticsearch cluster update <cluster_name_or_ID> \ --datanode-disk-size <Data_node_storage_size_in_GB> \ --masternode-disk-size <Master_node_storage_size_in_GB>
Where:
--datanode-disk-size
: Storage size in GB for hosts with the Data node role.--masternode-disk-size
: Storage size in GB for hosts with the Master node role.
You can request the cluster name and ID with the list of clusters in the folder.
To increase the cluster storage size:
-
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 Elasticsearch cluster configuration fields, see the Terraform provider documentation
. -
In the Managed Service for Elasticsearch cluster description, change the
disk_size
attribute value underconfig.data_node.resources
orconfig.master_node.resources
:resource "yandex_mdb_elasticsearch_cluster" "<cluster_name>" { ... config { data_node { resources { disk_size = <storage_size_in_GB> ... } } master_node { resources { disk_size = <storage_size_in_GB> ... } } } }
-
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.
-
Time limits
A Terraform provider sets the timeout for Managed Service for Elasticsearch cluster operations:
- Creating a cluster, including by restoring one from a backup: 30 minutes.
- Editing a cluster: 60 minutes.
- Deleting a cluster: 15 minutes.
Operations exceeding the set timeout are interrupted.
How do I change these limits?
Add the
timeouts
block to the cluster description, for example:resource "yandex_mdb_elasticsearch_cluster" "<cluster_name>" { ... timeouts { create = "1h30m" # 1 hour 30 minutes update = "2h" # 2 hours delete = "30m" # 30 minutes } }
-
To increase the cluster storage size, 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.You can get the cluster ID with a list of clusters in the folder.
-
Required storage size (in bytes) in the following parameters:
configSpec.elasticsearchSpec.dataNode.resources.diskSize
: For hosts with the Data node role.configSpec.elasticsearchSpec.masterNode.resources.diskSize
: For hosts with the Master node role.
-
List of settings to update in the
updateMask
parameter.
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.
Changing Elasticsearch settings
You can change the DBMS settings of the hosts in your cluster.
Warning
You cannot update Elasticsearch settings with the Elasticsearch API.
- Go to the folder page and select Managed Service for Elasticsearch.
- Select a cluster and click
Edit in the top panel. - Change the Elasticsearch settings by clicking Settings under DBMS settings.
- Click Save.
- 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 Elasticsearch server settings:
-
View the full list of settings specified for the cluster:
yc managed-elasticsearch cluster get <cluster_name_or_ID> --full
-
View a description of the update cluster configuration CLI command:
yc managed-elasticsearch cluster update-config --help
-
Set the required parameter values:
yc managed-elasticsearch cluster update-config <cluster_name_or_ID> \ --set <parameter_1_name>=<value_1>,<parameter_2_name>=<value_2>,...
All the supported parameters are listed in Elasticsearch settings.
To change Elasticsearch 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.You can get the cluster ID with a list of clusters in the folder.
-
Required DBMS values in the
configSpec.elasticsearchSpec.dataNode.elastcsearchConfig_7
parameter. -
List of settings to update in the
updateMask
parameter. If you skip this parameter, the API method will reset any cluster settings that are not explicitly specified in the request to their default values.
All supported settings are described in the Elasticsearch settings section and the API reference.
Changing the admin password
- In the management console
, go to the folder page and select Managed Service for Elasticsearch. - Select a cluster and click
Edit in the top panel. - Specify the
admin
user password in the User section. - 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
user's cluster password:
-
View the description of the update cluster CLI command:
yc managed-elasticsearch cluster update --help
-
Specify a new password in the cluster update command using one of the available methods:
-
Entering a password in interactive mode.
yc managed-elasticsearch cluster update <cluster_name> \ --read-admin-password
-
Entering a password as plain text (less secure method).
yc managed-elasticsearch cluster update <cluster_name> \ --admin-password <new_password>
-
Generating a password automatically. The generated password will be output to the console.
yc managed-elasticsearch cluster update <cluster_name> \ --generate-admin-password
-
Managed Service for Elasticsearch will run the admin
password update command for the cluster.
-
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 Elasticsearch cluster configuration fields, see the Terraform provider documentation
. -
In the Managed Service for Elasticsearch cluster description, change the
admin_password
attribute value underconfig
:resource "yandex_mdb_elasticsearch_cluster" "<cluster_name>" { ... config { admin_password = "<new_admin_user_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.
-
Time limits
A Terraform provider sets the timeout for Managed Service for Elasticsearch cluster operations:
- Creating a cluster, including by restoring one from a backup: 30 minutes.
- Editing a cluster: 60 minutes.
- Deleting a cluster: 15 minutes.
Operations exceeding the set timeout are interrupted.
How do I change these limits?
Add the
timeouts
block to the cluster description, for example:resource "yandex_mdb_elasticsearch_cluster" "<cluster_name>" { ... timeouts { create = "1h30m" # 1 hour 30 minutes update = "2h" # 2 hours delete = "30m" # 30 minutes } }
-
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.You can get the cluster ID with a list of clusters in the folder.
-
New password in the
configSpec.adminPassword
parameter. The maximum password length is 128 characters. -
List of settings to update (in this case,
configSpec.adminPassword
) in theupdateMask
parameter.
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.
Changing additional cluster settings
-
In the management console
, go to the folder page and select Managed Service for Elasticsearch. -
Select a 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.
-
-
Set the DBMS settings:
You can configure the
Fielddata cache size
parameter: a percentage or an absolute value of the dynamic memory structure allocated for thefielddata
cache. For example, 10% or 512 MB. -
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.
-
View the description of the update cluster CLI command:
yc managed-elasticsearch cluster update --help
-
Run the following command with a list of settings to update:
yc managed-elasticsearch cluster update <cluster_name_or_ID> \ --plugins <plugin_1_name>,...,<plugin_N_name> \ --maintenance-window type=<maintenance_type>,` `day=<day_of_week>,` `hour=<hour> \ --deletion-protection=<deletion_protection>
You can change the following settings:
-
--plugins
: List of Elasticsearch plugins available in the cluster. Plugins that are not on the list will be disabled. -
--maintenance-window
: Maintenance window settings (including for disabled clusters), wheretype
is the maintenance type:anytime
(default): Any time.weekly
: On a schedule. If setting this value, specify the day of week and the hour:day
: Day of week inDDD
format:MON
,TUE
,WED
,THU
,FRI
,SAT
, orSUN
.hour
: Hour (UTC) inHH
format:1
to24
.
-
--deletion-protection
: 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.
You can get the cluster ID and name with a 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 Elasticsearch cluster configuration fields, see the Terraform provider documentation
. -
To set up the maintenance window (for disabled clusters as well), add the
maintenance_window
block to the cluster description:resource "yandex_mdb_elasticsearch_cluster" "<cluster_name>" { ... maintenance_window { type = <maintenance_type> day = <day_of_week> hour = <hour> } ... }
Where:
type
: Maintenance type. The possible values include:anytime
: Anytime.weekly
: By schedule.
day
: Day of the week for theweekly
type inDDD
format, e.g.,MON
.hour
: Hour of the day for theweekly
type in theHH
format, e.g.,21
.
-
To change the list of Elasticsearch plugins, change the value of the
plugins
parameter underconfig
in the cluster description:resource "yandex_mdb_elasticsearch_cluster" "<cluster_name>" { ... config { plugins = [ "<list_of_plugin_names>" ] } }
Plugins that are not on the list will be disabled.
-
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_elasticsearch_cluster" "<cluster_name>" { ... deletion_protection = <deletion_protection> }
Where
deletion_protection
is the cluster deletion protection,true
orfalse
.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.
-
Time limits
A Terraform provider sets the timeout for Managed Service for Elasticsearch cluster operations:
- Creating a cluster, including by restoring one from a backup: 30 minutes.
- Editing a cluster: 60 minutes.
- Deleting a cluster: 15 minutes.
Operations exceeding the set timeout are interrupted.
How do I change these limits?
Add the
timeouts
block to the cluster description, for example:resource "yandex_mdb_elasticsearch_cluster" "<cluster_name>" { ... timeouts { create = "1h30m" # 1 hour 30 minutes update = "2h" # 2 hours delete = "30m" # 30 minutes } }
-
To change additional cluster 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.You can get the cluster ID with a list of clusters in the folder.
-
List of Elasticsearch plugins in the
plugins
parameter. -
Maintenance window settings (including for disabled clusters) in the
maintenanceWindow
parameter. -
Cluster deletion protection settings in the
deletionProtection
parameter.Cluster deletion protection will not prevent a manual connection to a cluster to delete data.
-
Settings for access from Yandex Data Transfer in the
configSpec.access.dataTransfer
parameter.
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.