Updated on 2024-11-29 GMT+08:00

EsMaster Memory Overflows During Elasticsearch Cluster Restart

Symptom

The EsMaster memory overflows during the restart of the Elasticsearch cluster.

java.lang.OutOfMemoryError: Java heap space

Cause Analysis

  • The Elasticsearch cluster has over 300 instances.
  • The Elasticsearch cluster has over 70000 shards.
  • The memory is insufficient because EsMaster manages too many instances or shards. In this case, you need to optimize the cluster memory.

Solution

  1. Log in to FusionInsight Manager and choose Cluster > Services > Elasticsearch. Click Configurations then All Configurations.
  2. Search for GC_OPTS of the EsMaster instance, set it to a larger value, and click Save to save the configuration.

    • You are advised to set Xms and Xmx to a value greater than 60 GB based on the remaining memory of the instance.
    • Ensure that the values of Xms and Xmx are the same.

  3. On the Dashboard tab page of the Elasticsearch service, choose More > Restart Service. Verify the identity and click OK to restart the Elasticsearch service.