Elasticsearch Fails to be Started Because of the Inconsistent Xms and Xmx Configurations of the Memory
Symptom
- A message is displayed indicating that the Elasticsearch instance fails to be started. The details indicate that the values of Xms and Xmx are inconsistent.
- View the Elasticsearch background logs. The following error information is displayed, indicating that the startup fails because the initial memory size is inconsistent with the maximum memory size.
vi /var/log/Bigdata/elasticsearch/esnode1/elasticsearch_cluster.log
2018-12-11T17:21:49,670][INFO ][o.e.b.BootstrapChecks ] [EsNode1] bound or publishing to a non-loopback address, enforcing bootstrap checks [2018-12-11T17:21:49,673][ERROR][o.e.b.Bootstrap ] [EsNode1] node validation exception [1] bootstrap checks failed [1]: initial heap size [536870912] not equal to maximum heap size [1073741824]; this can cause resize pauses and prevents mlockall from locking the entire heap [2018-12-11T17:21:49,677][INFO ][o.e.n.Node ] [EsNode1] stopping ... [2018-12-11T17:21:49,708][INFO ][o.e.n.Node ] [EsNode1] stopped [2018-12-11T17:21:49,708][INFO ][o.e.n.Node ] [EsNode1] closing ... [2018-12-11T17:21:49,721][INFO ][o.e.n.Node ] [EsNode1] closed
Cause Analysis
If the JVM is started with the initial heap size (Xms) and maximum heap size (Xmx) inconsistently configured, the size of the JVM heap may be adjusted during system use. As a result, the system may be suspended. To avoid the suspension caused by these adjustments, you must ensure that the initial heap size (Xms) is consistent with the maximum heap size (Xmx), then start the JVM. In addition, if the bootstrap.memory_lock is enabled, the initial heap size (Xms) will be locked by the JVM during the startup. If the initial heap size is inconsistent with the maximum heap size, not all JVM heaps will be locked in memory after the size is readjusted.
Therefore, this fault is caused by the Elasticsearch kernel restriction. Specifically, to avoid this fault, the initial memory size (Xms) must be consistent with the maximum memory size (Xmx) of the startup parameter.
Solution
- Log in to Manager and choose Cluster > Name of the desired cluster > Services > Elasticsearch > Configurations.
- Change the initial memory size (Xms) and maximum memory size (Xmx) of the GC_OPTS parameter of the Elasticsearch instance to the same one, and restart the Elasticsearch.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot