Skip to content
This repository has been archived by the owner on Sep 19, 2018. It is now read-only.

mlockall & capabilities not working #21

Closed
jimmidyson opened this issue Nov 19, 2015 · 6 comments
Closed

mlockall & capabilities not working #21

jimmidyson opened this issue Nov 19, 2015 · 6 comments

Comments

@jimmidyson
Copy link
Contributor

$ docker run --rm --cap-add=IPC_LOCK --privileged elasticsearch:2.0.0 -Des.bootstrap.mlockall=true

[2015-11-19 20:16:32,368][WARN ][bootstrap                ] Unable to lock JVM Memory: error=12,reason=Cannot allocate memory
[2015-11-19 20:16:32,370][WARN ][bootstrap                ] This can result in part of the JVM being swapped out.
[2015-11-19 20:16:32,370][WARN ][bootstrap                ] Increase RLIMIT_MEMLOCK, soft limit: 65536, hard limit: 65536
[2015-11-19 20:16:32,370][WARN ][bootstrap                ] These can be adjusted by modifying /etc/security/limits.conf, for example: 
        # allow user 'elasticsearch' mlockall
        elasticsearch soft memlock unlimited
        elasticsearch hard memlock unlimited
@jimmidyson
Copy link
Contributor Author

@pires Any ideas?

@pires
Copy link
Contributor

pires commented Nov 19, 2015

@jimmidyson works with my image.

$ docker run --rm --cap-add=IPC_LOCK --privileged quay.io/pires/docker-elasticsearch:2.0.0
log4j:WARN No such property [maxBackupIndex] in org.apache.log4j.DailyRollingFileAppender.
log4j:WARN No such property [maxBackupIndex] in org.apache.log4j.DailyRollingFileAppender.
log4j:WARN No such property [maxBackupIndex] in org.apache.log4j.DailyRollingFileAppender.
[2015-11-19 21:10:49,985][INFO ][node                     ] [Impala] version[2.0.0], pid[14], build[de54438/2015-10-22T08:09:48Z]
[2015-11-19 21:10:49,987][INFO ][node                     ] [Impala] initializing ...
[2015-11-19 21:10:50,070][INFO ][plugins                  ] [Impala] loaded [], sites []
[2015-11-19 21:10:50,221][INFO ][env                      ] [Impala] using [1] data paths, mounts [[/data (/dev/sda1)]], net usable_space [15.8gb], net total_space [18.1gb], spins? [possibly], types [ext4]
[2015-11-19 21:10:53,450][INFO ][node                     ] [Impala] initialized
[2015-11-19 21:10:53,462][INFO ][node                     ] [Impala] starting ...
[2015-11-19 21:10:53,627][INFO ][transport                ] [Impala] publish_address {127.0.0.1:9300}, bound_addresses {127.0.0.1:9300}, {[::1]:9300}
[2015-11-19 21:10:53,662][INFO ][discovery                ] [Impala] elasticsearch-default/bOVA1h6jQPejerv0cbClcw
[2015-11-19 21:10:56,768][INFO ][cluster.service          ] [Impala] new_master {Impala}{bOVA1h6jQPejerv0cbClcw}{127.0.0.1}{127.0.0.1:9300}{master=true}, reason: zen-disco-join(elected_as_master, [0] joins received)
[2015-11-19 21:10:56,829][INFO ][http                     ] [Impala] publish_address {127.0.0.1:9200}, bound_addresses {127.0.0.1:9200}, {[::1]:9200}
[2015-11-19 21:10:56,832][INFO ][node                     ] [Impala] started
[2015-11-19 21:10:56,851][INFO ][gateway                  ] [Impala] recovered [0] indices into cluster_state

@jimmidyson
Copy link
Contributor Author

Raised docker-library/elasticsearch#70

@jimmidyson
Copy link
Contributor Author

Docker image needs to be run with --ulimit memlock=-1:-1 & then all is good. Now how to do that in Kubernetes?

@pires
Copy link
Contributor

pires commented Nov 20, 2015

Still open it seems kubernetes/kubernetes#3595

@jimmidyson
Copy link
Contributor Author

Reading https://www.elastic.co/guide/en/elasticsearch/guide/current/heap-sizing.html looks like we should only resort to enabling mlockall if we can't disable swap or set swappiness to 1. Both these options should be doable for most users so closing this for now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants