Alibaba Cloud Elasticsearch V6.7.0 and later allows you to configure and switch between garbage collectors if the memory size per data node in your Elasticsearch cluster is greater than or equal to 32 GiB. Supported garbage collectors include CMS and G1.

Prerequisites

The version of your Elasticsearch cluster is V6.7.0 or later. The memory size per data node in your cluster is greater than or equal to 32 GiB. Otherwise, you must upgrade the cluster specifications. For more information, see Upgrade the configuration of a cluster.
Note Elasticsearch clusters that do not meet these requirements can use only the CMS garbage collector and cannot switch to the G1 garbage collector.

Procedure

  1. Log on to the Alibaba Cloud Elasticsearch console.
  2. In the top navigation bar, select the region where your Alibaba Cloud Elasticsearch cluster resides.
  3. Find the target cluster and click its ID.
  4. In the left-side navigation pane of the cluster details page, click Cluster Configuration.
  5. On the Cluster Configuration page, click Edit Configuration on the right side of Garbage Collectors.
    Warning After you change the garbage collector type, the system will restart the cluster. Make sure that the restart does not affect your services.
  6. In the Edit Configuration pane, select G1 and click OK to switch to the G1 garbage collector.
    Change the garbage collector type

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