Updating the Elasticsearch version and edition
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.
In the Managed Service for Elasticsearch cluster, you can update the version and update the edition of Elasticsearch.
To learn more about updates within a single version and host maintenance, see Maintenance.
Elasticsearch version upgrade
You can update a Managed Service for Elasticsearch cluster to a newer Elasticsearch version.
Viewing a list of available Elasticsearch versions
- In the management console
, go to the folder page and select Managed Service for Elasticsearch. - Select a cluster and click
Edit. - Open the list in the Version field.
Before a version upgrade
Make sure this does not affect your applications:
- See the Elasticsearch changelog
to check how updates might affect your applications. - Try upgrading the version on a test cluster. You can deploy it from a backup of the main cluster.
- Create a backup of the main cluster directly before the version upgrade.
Updating the Elasticsearch version
- In the management console
, go to the folder page and select Managed Service for Elasticsearch. - Select a cluster and click
Edit. - In the Version field, select the appropriate Elasticsearch version.
- 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.
-
Get a list of your Elasticsearch clusters:
yc managed-elasticsearch cluster list
-
Get information about the cluster you need and check the version in the
config.version
property:yc managed-elasticsearch cluster get <cluster_name_or_ID>
-
Update the version:
yc managed-elasticsearch cluster update <cluster_name_or_ID> --version <Elasticsearch_version>
-
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 the Managed Service for Elasticsearch cluster description, add the
config.version
field or change its value if it is already there:resource "yandex_mdb_elasticsearch_cluster" "<cluster_name>" { ... config { version = "<Elasticsearch_version>" } }
-
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 a version, 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 Elasticsearch version in the
configSpec.version
parameter. -
List of updatable cluster configuration fields in the
updateMask
parameter (in this case,configSpec.version
).
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.
Updating the Elasticsearch edition
Note
As of June 13, 2022, the Gold
edition has been discontinued in Managed Service for Elasticsearch clusters. You cannot switch to it from the Basic
or Platinum
edition. On July 6, 2022, all Gold
edition clusters were automatically upgraded to Platinum
.
You can change the Elasticsearch edition used by the cluster. Before you downgrade the edition, make sure that reduced functionality will not affect your applications.
- In the management console
, go to the folder page and select Managed Service for Elasticsearch. - Select a cluster and click
Edit. - In the Edition field, select the Elasticsearch edition you need:
Basic
orPlatinum
. - 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.
-
Get a list of your Elasticsearch clusters:
yc managed-elasticsearch cluster list
-
Get information about the cluster you need and check the edition in the
config.edition
property:yc managed-elasticsearch cluster get <cluster_name_or_ID>
-
Update the edition:
yc managed-elasticsearch cluster update <cluster_name_or_ID> \ --edition <Elasticsearch_edition>
Where
--edition
is the Elasticsearch edition,basic
orplatinum
.
-
Open the current Terraform configuration file with an infrastructure plan.
For more information about creating this file, see Creating clusters.
-
Add the
config.edition
field to the Managed Service for Elasticsearch cluster description or edit it if the field already exists:resource "yandex_mdb_elasticsearch_cluster" "<cluster_name>" { ... config { edition = "<Elasticsearch_edition>" ... } ... }
Where
edition
is the Elasticsearch edition,basic
orplatinum
. -
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.
-
-
For more information, see the Terraform provider documentation
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 Elasticsearch edition, 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 Elasticsearch edition in the
configSpec.edition
parameter. -
List of updatable cluster configuration fields in the
updateMask
parameter (in this case,configSpec.edition
).
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.