elasticsearch-docker-swarm icon indicating copy to clipboard operation
elasticsearch-docker-swarm copied to clipboard

memory locking requested for elasticsearch process but memory is not locked

Open recepkabatas opened this issue 5 years ago • 1 comments
trafficstars

Hello, I have 4 VM Server (4 different physical server) and i've docker swarm. it's working all good. i just changed version and persistent volume on stack-elastic.yml

but i'm having this error.

[2020-10-23T07:30:45,386][INFO ][o.e.t.TransportService ] [es-coordination] publish_address {10.0.3.59:9300}, bound_addresses {0.0.0.0:9300} [2020-10-23T07:30:45,391][INFO ][o.e.b.BootstrapChecks ] [es-coordination] bound or publishing to a non-loopback address, enforcing bootstrap checks ERROR: [1] bootstrap checks failed [1]: memory locking requested for elasticsearch process but memory is not locked [2020-10-23T07:30:45,608][INFO ][o.e.n.Node ] [es-coordination] stopping ... [2020-10-23T07:30:45,637][INFO ][o.e.n.Node ] [es-coordination] stopped [2020-10-23T07:30:45,637][INFO ][o.e.n.Node ] [es-coordination] closing ... [2020-10-23T07:30:45,643][INFO ][o.e.n.Node ] [es-coordination] closed [2020-10-23T07:30:45,645][INFO ][o.e.x.m.p.NativeController] [es-coordination] Native controller process has stopped - no new native processes can be started

Make sure to tune your VM to run Elasticsearch cluster by executing on each server:

sudo sysctl -w vm.max_map_count=262144

add --default-ulimit memlock=-1 to Dockerd

You can manage that by executing this command on each server consiting Swarm cluter:

sudo "sed -i '/ExecStart=/usr/bin/dockerd/ s/$/--default-ulimit memlock=-1/' /etc/systemd/system/docker.service.d/10-machine.conf"

i have only understant and run this command

sudo sysctl -w vm.max_map_count=262144

and i research a little bit and tried this commands; echo -e "[Service]\nLimitMEMLOCK=infinity" | SYSTEMD_EDITOR=tee systemctl edit docker.service
systemctl daemon-reload systemctl restart docker

First question how can i use your methods on my CENTOS7 VM machine and i have a lot of ram on VM what's memory is not locked means ?

Thanks

recepkabatas avatar Oct 23 '20 07:10 recepkabatas

Wished I checked here earlier...for me, I did the above but dockerd still didn't start up with the memlock=-1:=-1 option.

So i did this... sudo vim /lib/systemd/system/docker.service #Added the below in the docker.service file ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock --default-ulimit memlock=-1:-1

jksho avatar Nov 10 '20 22:11 jksho