If the memory size of each data node in your Alibaba Cloud Elasticsearch cluster of V6.7.0 or later is 32 GiB or larger, you can configure a garbage collector for the cluster. You can also change the garbage collector type for the cluster. The following types of garbage collectors are supported: CMS and G1.

Prerequisites

The version of your Elasticsearch cluster is V6.7.0 or later. The memory size of each data node in the cluster is no less than 32 GiB. If these requirements are not met, you must upgrade the configuration of the cluster. For more information, see Upgrade the configuration of a cluster.
Note Elasticsearch clusters that do not meet the preceding requirements can use only CMS garbage collectors. In addition, you cannot switch the garbage collectors to G1 garbage collectors for the clusters.

Procedure

  1. Log on to the Alibaba Cloud Elasticsearch console.
  2. In the top navigation bar, select the region where your cluster resides.
  3. In the left-side navigation pane, click Elasticsearch Clusters. On the page that appears, find the target cluster and click its ID in the Cluster ID/Name column.
  4. In the left-side navigation pane of the page that appears, click Cluster Configuration.
  5. In the Basic Configuration section, click Modify next to Garbage Collectors.
    Warning After you change the garbage collector type, the system restarts the cluster. Therefore, before you change the garbage collector type, make sure that the restart does not affect your services.
  6. In the Edit Configuration pane, select G1 and click OK.
    Change the garbage collector type

    After you confirm the operation, the system restarts the cluster. After the cluster is restarted, the garbage collector is switched to G1.