All Products
Search
Document Center

Elasticsearch:Downgrade the configuration of a cluster

Last Updated:Mar 20, 2024

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 Active 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.

    Note
    • Before 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

  • You are not allowed to reduce disk space or downgrade Kibana nodes.

  • 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.

      Note

      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: enhanced 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.

      Note

      You cannot update ESSDs at performance level 0 to SSDs.

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.

  • 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.

  • Note

    During a configuration downgrade, you can check the price of your order on the Upgrade/Downgrade page in real time.

Procedure

  1. Log on to the Alibaba Cloud Elasticsearch console.
  2. 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.

  3. On the Elasticsearch Clusters page, find your cluster and choose 更多 > Downgrade Configuration in the Actions column.

  4. Change the specifications or disk type of the nodes that you want to downgrade.

  5. 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

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.