If your business has traffic peak and off-peak hours, the specifications of nodes in your Alibaba Cloud Elasticsearch cluster may be higher than the specifications required by your business during off-peak hours. In this case, you can downgrade the configuration of your cluster to reduce costs. You can downgrade nodes or change the disk types of nodes.
Prerequisites
The following operations are performed:
Make sure that the Elasticsearch cluster whose configuration you want to downgrade is in the Normal state (indicated by the color green).
In the Kibana console of your cluster, check whether your cluster stores indexes in the close state. If your cluster stores such indexes, you must open the indexes. Otherwise, the upgrade fails.
Run the following command to view the statuses of indexes:
GET /_cat/indices?v
Run the following command to open an index in the close state:
POST /<index_name>/_open
Replace <index_name> with the name of the index in the close state.
In the Kibana console of the cluster, run the following command to check the number of replica shards for indexes. Make sure that at least one replica shard is configured for each primary shard.
NoteBefore you make a change to a multi-zone cluster, you must make sure that the number of replica shards for each index in the cluster is less than the number of zones in which the cluster is deployed. We recommend that you set the number of replica shards to 1. After the change is complete, you can manually increase the number of replica shards based on your business requirements. For information about how to change the number of replica shards for indexes in a cluster, see Index Templates.
If the cluster is heavily loaded, the number of replica shards is 0, and a large number of data writes or queries are performed during a configuration downgrade, access to the cluster may be time out. In addition, the high availability mechanism cannot be implemented, and business stability cannot be ensured.
GET _cat/indices?v
Limits
The configuration of a cluster can be downgraded only if the following conditions are met:
Downgrade interval
The interval between two configuration downgrades of a cluster must be no less than 30 minutes.
Cluster load
A cluster may contain multiple types of nodes. To ensure the stability of a cluster that contains multiple types of nodes during the configuration downgrade of the cluster, the load of the cluster must meet the conditions listed in the following table.
Node type
CPU utilization
JVM heap memory usage
Dedicated master node
Maximum value of a single node over the last day: < 30%
Maximum value of a single node over the last day: < 25%
Other types of nodes
Both of the following conditions must be met:
Maximum value of a single node over the last day: < 50%
Average value of all nodes of the same type over the last day: < 30%
Both of the following conditions must be met:
Maximum value of a single node over the last day: < 50%
Average value of all nodes of the same type over the last day: < 30%
Specifications
The selected vCPU and memory specifications are greater than or equal to half of the current specifications and are not the following specifications: 1 vCPU and 2 GiB of memory, 2 vCPUs and 2 GiB of memory, 2 vCPUs and 4 GiB of memory, and 4 vCPUs and 4 GiB of memory.
NoteYou cannot downgrade Kibana nodes to 1 vCPU and 2 GiB of memory.
If you want to downgrade the configuration of a cluster to 2 vCPUs and 4 GiB of memory or to 4 vCPUs and 4 GiB of memory, you need to create a cluster with such configuration and migrate data from the original cluster to the new cluster. You can use Logstash to migrate data.
Disk type
Disks with high storage performance can be updated to disks with low storage performance. The following types of disks are listed in descending order of their storage performance: Enterprise SSDs (ESSDs), standard SSDs, and ultra disks. You can update the disk types of nodes in your cluster based on your business requirements. For more information about disks, see Disks.
NoteYou cannot update ESSDs at performance level 0 to SSDs.
You can downgrade the storage space of data nodes for Elasticsearch clusters only of a later version, such as V7.16, V8.5, or V8.9. To ensure the stability of a cluster after a downgrade, the disk usage of the cluster must be less than a specific threshold. You need to make sure that the disk usage after the downgrade is less than 60%. This indicates that the proportion of used disk space to disk space after downgrade must be less than
60%
.
Precautions
In most cases, if the indexes of your cluster have replica shards and the load of your cluster is normal, your cluster can still provide services during a cluster configuration change. The following items indicate that the load of a cluster is normal: The CPU utilization of each node in the cluster is about 60%, the heap memory usage of each node in the cluster is about 50%, and the value of NodeLoad_1m for each node is less than the number of vCPUs for the node.
After you downgrade the configuration of your cluster, the system restarts the cluster to make the changes take effect. The time required for the restart depends on the specifications, data structure, and data volume of the cluster. In most cases, the restart requires a few hours. Therefore, we recommend that you downgrade the configuration of your cluster during off-peak hours. For more information, see Restart a cluster or node.
During the configuration downgrade of your cluster, data stored in the cluster is not lost. However, if the cluster is overloaded or is in an abnormal state, access to the cluster may time out. We recommend that you configure an access retry mechanism for your client and increase the number of replica shards before you downgrade the configuration of your cluster.
Configuration downgrades may cause additional risks, such as data loss, for clusters with non-standard specifications, such as a cluster that contains only two data nodes. Therefore, proceed with caution.
Kibana is a data visualization platform used only for operations such as data queries. In most cases, Kibana is used for ad hoc queries. Therefore, verification on historical thresholds is not configured for Kibana node downgrades. You can configure or adjust specifications for Kibana nodes based on your business requirements. If you want to use Kibana more frequently in the future, you need to upgrade Kibana nodes at the earliest opportunity.
After you submit a configuration downgrade order, your cluster is charged based on the new configuration. For more information about billing rules, see Pay-as-you-go and Subscription.
NoteDuring a configuration downgrade, you can check the price of your order on the Downgrade page in real time.
Procedure
- Log on to the Alibaba Cloud Elasticsearch console.
In the top navigation bar, select the resource group to which your cluster belongs and the region where your cluster resides. In the left-side navigation pane, click Elasticsearch Clusters.
On the Elasticsearch Clusters page, find your cluster and choose in the Actions column.
Change the specifications or disk type of the nodes that you want to downgrade.
Read the terms of service, select Elasticsearch Terms of Service, and then click Buy Now.
After you complete the payment, the system restarts the cluster to make the changes take effect.
FAQ
What do I do if I fail to update the configuration of my Elasticsearch cluster?
Can I change the cloud disk type of an Elasticsearch cluster?
Are services affected when I modify the configuration of an Elasticsearch cluster?
Can I downgrade the configuration of an Elasticsearch cluster? If yes, how do I do?
Why am I unable to downgrade the configuration of warm nodes in my Elasticsearch cluster?
References
For information about the API operation that is used for downgrading the configuration of a cluster, see UpdateInstance.
Before you downgrade the configuration of your Elasticsearch cluster, perform the operations provided in Evaluate specifications and storage capacity and make sure that the conditions provided in Limits are met. This ensures that your cluster has sufficient storage after the downgrade. If the cluster load is high after the downgrade, we recommend that you upgrade the configuration at the earliest opportunity. For information about how to upgrade the configuration of a cluster, see Upgrade the configuration of a cluster.