All Products
Search
Document Center

Elasticsearch:Migrate nodes in a zone

Last Updated:Nov 06, 2024

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

The following operations are performed:

  • Make sure that a zone with sufficient resources exists within the current account.

    We recommend that you select the destination zone from bottom to top in alphabetical order because the zone 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 upgrade the configuration of your Elasticsearch cluster. For more information, see Upgrade the configuration of a cluster.

  • Make sure that your Elasticsearch cluster is in the Normal state.

    You can run the GET _cat/health?v command to view the status of the cluster.

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

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

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

Procedure

  1. Log on to the Alibaba Cloud Elasticsearch console.
  2. In the left-side navigation pane, click Elasticsearch Clusters.
  3. Navigate to the desired cluster.
    1. In the top navigation bar, select the resource group to which the cluster belongs and the region where the cluster resides.
    2. On the Elasticsearch Clusters page, find the cluster and click its ID.
  4. In the Node Visualization section of the Basic Information page, move the pointer over the zone whose nodes you want to migrate. Then, click Migrate.

    image

  5. In the Migrate Nodes dialog box, configure Destination Zone and vSwitch.

    Parameter

    Description

    Destination Zone

    The destination zone may also have insufficient resources. We recommend that you select the destination zone from bottom to top in alphabetical order. For example, if both cn-hangzhou-e and cn-hangzhou-h are available, select cn-hangzhou-h.

    vSwitch

    If your cluster is a single-zone cluster, you must select a new vSwitch for node migration. If your cluster is a multi-zone cluster or a cluster deployed on the Alibaba Finance Cloud, you do not need to select a new vSwitch.

    Important
    • After the nodes in the zone are migrated, the IP addresses of the nodes change. If you specified the IP addresses in the configuration of your cluster, you must update the IP addresses after the migration.

    • Node migration triggers a cluster restart. During the restart, the cluster can still provide services, but the services may be unstable. Therefore, we recommend that you migrate nodes during off-peak hours.

  6. Read the terms of data migration, select the check box, and then click OK.

    Then, the system restarts the cluster. After the cluster is restarted, the nodes are migrated to the destination zone.

    Important

    After the migration, the original zone is still displayed on the Basic Information and Upgrade/Downgrade pages in the Elasticsearch console. This does not affect the use of the cluster in the new zone. You can view the actual zone where the cluster resides in the Node Visualization section of the Basic Information page.