ElasticSearch Error – this can cause resize pauses and prevents mlockall from locking the entire heap

Error Message

[ec2-user@es-data01 bin]$ OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
ERROR: [1] bootstrap checks failed
[1]: initial heap size [1048576000] not equal to maximum heap size [2097152000]; this can cause resize pauses and prevents mlockall from locking the entire heap
ERROR: Elasticsearch did not exit normally - check the logs at /home/ec2-user/elasticsearch-7.6.0/logs/devopsschool.log

Solutions

Setting the parameter -Xms to the same value of -Xmx in /etc/elasticsearch/jvm.options solved the problem 🙂 Thanks

export ES_HEAP_SIZE=2024m
echo $ES_HEAP_SIZE
export ES_JAVA_OPTS="-Xms1000m -Xmx2000m" /home/ec2-user/elasticsearch-7.6.0/bin/elasticsearch

$ cd /home/ec2-user/elasticsearch-7.6.0/config
$ vi jvm.options # Make -Xmx1g to -Xmx1g
$ more /home/ec2-user/elasticsearch-7.6.0/config/jvm.options | grep Xm
CLIENT
.........
-Xms1g
-Xmx1g

Master
........
-Xms2g
-Xmx2g

DATA
.......
-Xms1g
-Xmx1g
Rajesh Kumar
Follow me