# Elasticsearch Memlock with Docker

**URL:** <https://discuss.elastic.co/t/elasticsearch-memlock-with-docker/108556>\
**Category:** Elasticsearch\
**Created:** [November 21, 2017, 11:47am UTC](https://discuss.elastic.co/t/elasticsearch-memlock-with-docker/108556 "2017-11-21T11:47:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Burak\_Aydin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/burak_aydin/32/42583_2.png) [@Burak\_Aydin](https://discuss.elastic.co/u/Burak_Aydin)\
**Post date:** [November 21, 2017, 11:47am UTC](https://discuss.elastic.co/t/elasticsearch-memlock-with-docker/108556/1 "2017-11-21T11:47:32Z")

</div>

Hi, We are using elasticsearch in a Docker container with one node . We want to use memlock parameter as true. But when we set  
bootstrap.memory\_lock: true in elasticsearch.yml file we received ;

**ERROR: [1] bootstrap checks failed**  
**[1]: memory locking requested for elasticsearch process but memory is not locked**

* * *

_ **Here elasticsearch.yml file ;** _

http.host: 0.0.0.0

transport.host: 0.0.0.0  
#discovery.zen.minimum\_master\_nodes: 1

bootstrap.memory\_lock: true

## #index.refresh\_interval: 30s #index.translog.flush\_threshold\_ops: 50000

Here [docker-entrypoint.sh](http://docker-entrypoint.sh);

#!/bin/bash

set -e  
if ["${1:0:1}" = '-']; then  
set -- elasticsearch "$@"  
fi

if ["$1" = 'elasticsearch' -a "$(id -u)" = '0']; then  
# Change the ownership of user-mutable directories to elasticsearch  
for path in   
/usr/share/elasticsearch/data   
/usr/share/elasticsearch/logs   
; do  
chown -R elasticsearch:elasticsearch "$path"  
done

```
set -- gosu elasticsearch "$@"
#exec gosu elasticsearch "$BASH_SOURCE" "$@"

```

## fi exec "$@"

Could you please help us?

There is too many configuration suggestion on the web. We try some of them but couldn't find a exact solution.

The last we try to set this parameters with [entrypoint.sh](http://entrypoint.sh) in container;

echo "LimitMEMLOCK=infinity" \>\> /usr/lib/systemd/system/elasticsearch.service  
echo "MAX\_LOCKED\_MEMORY=unlimited" \>\> /etc/init.d/elasticsearch  
echo "elasticsearch soft memlock unlimited" \>\> /etc/security/limits.conf  
echo "elasticsearch hard memlock unlimited" \>\> /etc/security/limits.conf

But the error continues.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 19, 2017, 11:48am UTC](https://discuss.elastic.co/t/elasticsearch-memlock-with-docker/108556/2 "2017-12-19T11:48:00Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
