Before you upgrade the configuration of your Elasticsearch cluster, you can migrate the nodes in the zone where the cluster resides to another zone. This ensures that the zone where the cluster resides provides sufficient resources for the upgrade. This topic describes how to migrate the nodes in a zone.
Prerequisites
- A zone with sufficient resources exists within the current account.
We recommend that you select new zones from bottom to top in alphabetical order because these zones may have sufficient resources. For example, if both cn-hangzhou-e and cn-hangzhou-h are available, select cn-hangzhou-h. After you migrate nodes to another zone, you must manually update the configuration of your Elasticsearch cluster. For more information, see Upgrade the configuration of a cluster.
- Your Elasticsearch cluster is in the Active state.
You can run the
GET _cat/health?v
command to check the status of the cluster. - Log on to the Kibana console and 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
- Run the following command to view the statuses of indexes:
Precautions
- You can migrate the nodes only in a single zone to another zone at a time. If you want to migrate the nodes in multiple zones at a time, you must perform migration multiple times.
- After you migrate the nodes in a zone to another zone, the system performs a rolling restart for your cluster. The time required for the migration depends on the size, data volume, and load of your cluster. We recommend that you perform migration during off-peak hours.
- 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 migration. The following items indicate that the load of a cluster is normal: The CPU utilization of the cluster is about 60%, the heap memory usage of the cluster is about 50%, and the value of NodeLoad_1m is less than the number of vCPUs for the cluster.
- If the indexes of your cluster do not have replica shards, the load of the cluster is excessively high, and large amounts of data are written to or queried in your cluster, access timeouts may occur during migration. We recommend that you configure an access retry mechanism for your client before you migrate nodes in a zone. This reduces the impact on your business.