After you perform an operation on an Elasticsearch cluster or node, such as modifying the configuration of the cluster or node, you may need to restart the cluster or node to make the changes take effect. This topic describes how to restart an Elasticsearch cluster or node in the Elasticsearch console.
- The cluster is in the Active state (indicated by the color green), each index stored in the cluster has at least
one replica shard, and the resource usage of each node in the cluster is not high.
Notice When you make a change to a multi-zone cluster, make sure that the number of replica shards of each index in the cluster is less than the number of zones in which the cluster is deployed. After the change is complete, you can manually increase the number of replica shards based on your business requirements. For more information about how to change the number of replica shards of indexes in a cluster, see Index Templates.
You can view the resource usage of a node on the Cluster Monitoring page. For example, the value of NodeCPUUtilization(%) is about 80%, that of NodeHeapMemoryUtilization is about 50%, and that of NodeLoad_1m is less than the number of vCPUs for the node. For more information, see View cluster monitoring data.
- 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:
- Run the following command to open an index in the close state:
- Run the following command to view the statuses of indexes:
In most cases, if the load of a cluster is not high and indexes in the cluster have replica shards, the cluster can still provide services during a restart. In some cases, however, access timeouts may occur during a restart. For example, if a number of nodes in the cluster are forced to restart at a time, the cluster is heavily loaded and is not accessible, indexes in the cluster do not have replica shards, or large amounts of data are written or queried during a restart or forced restart, access timeouts may occur. In these cases, we recommend that you design a retry mechanism on your client first and restart the cluster during off-peak hours.
- Log on to the Elasticsearch console.
- In the left-side navigation pane, click Elasticsearch Clusters.
- Navigate to the desired cluster.
- In the top navigation bar, select the resource group to which the cluster belongs and the region where the cluster resides.
- In the left-side navigation pane, click Elasticsearch Clusters. On the Elasticsearch Clusters page, find the cluster and click its ID.
- In the upper-right corner of the Basic Information page, click Restart.
- In the Restart dialog box, configure the parameters.
Parameter Description Object The type of the object that you want to restart. Valid values:
- Cluster: indicates all nodes in the cluster.
- Node: indicates specific nodes in the cluster.
- Node Role: indicates specific types of nodes in the cluster.
Node The nodes or types of nodes that you want to restart. This parameter is displayed only if you set the Object parameter to Node or Node Role.
- If you set the Object parameter to Node, select one or more nodes that you want to restart.
- If you set the Object parameter to Node Role, select the type of the node that you want to restart, such as Client Nodes or Dedicated Master Nodes. You can select multiple types.
Change Blue-green Release Specifies whether to perform a blue-green restart. This parameter is displayed only if you set the Object parameter to Node or Node Role.If you select Change Blue-green Release, the system adds a node to your cluster, migrates the data on the original node to the new node, and removes the original node during the restart. If a hardware failure occurs on a node, you can use the Change Blue-green Release feature to remove the node.Notice
- If you want to use the Change Blue-green Release feature, make sure that your cluster is in the Active state. In addition, you must set the Restart Mode parameter to Restart.
- If you select Change Blue-green Release, the IP address of the node that you want to restart changes after the restart. If you have specified the IP address of the node in the configuration file of your cluster, you must update the IP address of the node in the configuration file after the restart.
Restart Mode The restart mode. Valid values:
- Restart: You can use this mode only if the cluster is in the Active state. Otherwise, you must use the Force Restart mode. If your cluster is in the Active state and you select the Restart mode, your
cluster can still provide services during the restart, but the restart is time-consuming.
- During the restart of a node, the CPU utilization and memory usage of the node surge. This may affect the service stability of your cluster for a short period of time.
- The time that is required to restart a cluster varies based on multiple factors, such as the volume of data stored in the cluster. You can view the restart progress in the Tasks dialog box.
- Force Restart: If your cluster is in an abnormal state (indicated by the color yellow or red),
you can use only this mode to restart the cluster or nodes.
Notice If the disk usage exceeds the value of cluster.routing.allocation.disk.watermark.low, your cluster may be in an abnormal state. In this case, do not perform the following operations on the cluster: scale-out, disk capacity expansion, restart, password reset, and other operations that may change the configuration of the cluster. Perform the preceding operations only after the state of the cluster becomes Active.
Concurrency The number of nodes that are restarted at the same time. This parameter is displayed only if you set the Restart Mode parameter to Force Restart. The default value is calculated by using the following formula: (1/Total number of nodes in the cluster) × 100. Unit: %. For example, if the concurrency is 10%, 10% of nodes in the cluster are restarted at the same time.
You can specify the concurrency to accelerate a forced restart. The higher the concurrency, the faster a forced restart, but the greater the impact on the cluster.Note The value of Estimated to Take is calculated by multiplying the average time of previous node restarts by the total number of nodes. The actual restart time prevails.
- Click OK. Note If you select the Force Restart mode, you must select Restart Cluster Forcibly to confirm the restart.
During the restart, the value of Status for the cluster is Initializing (indicated by the color yellow). You can view the details in the Tasks dialog box. After the restart succeeds, the value of Status becomes Active.