If you want to modify the configurations of an Elasticsearch cluster or node, or an Elasticsearch cluster or node encounters an exception, you may need to restart the Elasticsearch cluster or node. This topic describes how to restart an Elasticsearch cluster or node in the Elasticsearch console.
Prerequisites
- 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.
- To view the number of replica shards for the indexes in the cluster, log on to the
Kibana console of the cluster, run the
GET _cat/indices?v
command, and then view the value of the rep parameter for each index. If the value of the parameter for each index is greater than or equal to 1, each index has at least one replica shard. For more information about how to log on to the Kibana console, see Log on to the Kibana console. - To view the resource usage of each node in the cluster, go to 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.
- To view the number of replica shards for the indexes in the cluster, log on to the
Kibana console of the cluster, run the
- 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
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 the same 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.