Prevent OOM Killer Killing

I am new to elasticsearch, and I guess how I configured my server is not optimal, as I ran into a problem with the OOM killer killing the Elasticsearch / Java process after a while. This could probably be avoiding proper server configuration. Could you indicate what needs to be changed in the configuration for the smooth operation of ES?

On both of these servers (clustered), I sometimes return to the ES / java process that was killed.

Here is the current setting:

=============================================

Server 1 (Frontend Server) This server has 8 GB of RAM, and also works with a cannon, flask and Django.

elasticsearch.yml:

node.master: true
node.data: true
bootstrap.mlockall: true

/ etc / default / elasticsearch

ES_HEAP_SIZE=5g
MAX_OPEN_FILES=65535
MAX_LOCKED_MEMORY=unlimited

=============================================

2 ( Elasticsearch) 8 ,

elasticsearch.yml:

node.master: false
node.data: true
bootstrap.mlockall: true

/ ../ /elasticsearch

ES_HEAP_SIZE=5g
MAX_OPEN_FILES=65535
MAX_LOCKED_MEMORY=unlimited

===========================================

elasticsearch.yml "You should also make sure that the Elasticsearch process is allowed to lock the memory, eg. by using ulimit -l unlimited" , . - ?

, ...

myuser@es1:~$ sudo ulimit -l unlimited
sudo: ulimit: command not found
+4
2

, ES, 5.4.0 RedHat/Centos 7 ( , systemd).

4 :

1) /etc/sysconfig/elasticsearch

sysconfig: /etc/sysconfig/elasticsearch :

ES_JAVA_OPTS="-Xms4g -Xmx4g" 
MAX_LOCKED_MEMORY=unlimited

( 4g HALF )

2) /etc/security/limits.conf

config: /etc/security/limits.conf

elasticsearch soft memlock unlimited
elasticsearch hard memlock unlimited

3) /usr/lib/systemd/system/elasticsearch.service

script: /usr/lib/systemd/system/elasticsearch.service :

LimitMEMLOCK=infinity

daemon systemctl script

4) /etc/elasticsearch/elasticsearch.yml

elasticsearch : /etc/elasticsearch/elasticsearch.yml :

bootstrap.memory_lock: true

, node, , .

+7

All Articles