# I use kubernetes to run es ,the container can not run ,and i get the error:bootstrap checks failed \[1\]: memory locking requested for elasticsearch process but memory is not locked

**URL:** <https://discuss.elastic.co/t/i-use-kubernetes-to-run-es-the-container-can-not-run-and-i-get-the-error-bootstrap-checks-failed-1-memory-locking-requested-for-elasticsearch-process-but-memory-is-not-locked/90786>\
**Category:** Elasticsearch\
**Created:** [June 26, 2017, 7:09am UTC](https://discuss.elastic.co/t/i-use-kubernetes-to-run-es-the-container-can-not-run-and-i-get-the-error-bootstrap-checks-failed-1-memory-locking-requested-for-elasticsearch-process-but-memory-is-not-locked/90786 "2017-06-26T07:09:21Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![willJackson](https://avatars.discourse-cdn.com/v4/letter/w/958977/32.png) [@willJackson](https://discuss.elastic.co/u/willJackson)\
**Post date:** [June 26, 2017, 7:09am UTC](https://discuss.elastic.co/t/i-use-kubernetes-to-run-es-the-container-can-not-run-and-i-get-the-error-bootstrap-checks-failed-1-memory-locking-requested-for-elasticsearch-process-but-memory-is-not-locked/90786/1 "2017-06-26T07:09:21Z")

</div>

sh: error setting limit: Operation not permitted  
[2017-06-26T19:47:56,556][WARN][o.e.b.JNANatives] Unable to lock JVM Memory: error=12, reason=Out of memory  
[2017-06-26T19:47:56,561][WARN][o.e.b.JNANatives] This can result in part of the JVM being swapped out.  
[2017-06-26T19:47:56,561][WARN][o.e.b.JNANatives] Increase RLIMIT\_MEMLOCK, soft limit: 65536, hard limit: 65536  
[2017-06-26T19:47:56,562][WARN][o.e.b.JNANatives] These can be adjusted by modifying /etc/security/limits.conf, for example:  
# allow user 'elasticsearch' mlockall  
elasticsearch soft memlock unlimited  
elasticsearch hard memlock unlimited  
[2017-06-26T19:47:56,562][WARN][o.e.b.JNANatives] If you are logged in interactively, you will have to re-login for the new limits to take effect.  
[2017-06-26T19:47:56,849][INFO][o.e.n.Node] [3c1b1122-c60b-452b-b323-11a5e4957a3a] initializing ...  
[2017-06-26T19:47:57,038][INFO][o.e.e.NodeEnvironment] [3c1b1122-c60b-452b-b323-11a5e4957a3a] using [1] data paths, mounts [[/data (/dev/mapper/centos-root)]], net usable\_space [46.9gb], net total\_space [49.9gb], spins? [possibly], types [xfs]  
[2017-06-26T19:47:57,039][INFO][o.e.e.NodeEnvironment] [3c1b1122-c60b-452b-b323-11a5e4957a3a] heap size [1.9gb], compressed ordinary object pointers [true]  
[2017-06-26T19:47:57,041][INFO][o.e.n.Node] [3c1b1122-c60b-452b-b323-11a5e4957a3a] node name [3c1b1122-c60b-452b-b323-11a5e4957a3a], node ID [tQ-da20URuydKLGXfNFz4g]  
[2017-06-26T19:47:57,042][INFO][o.e.n.Node] [3c1b1122-c60b-452b-b323-11a5e4957a3a] version[5.4.2], pid[11], build[929b078/2017-06-15T02:29:28.122Z], OS[Linux/4.11.6-1.el7.elrepo.x86\_64/amd64], JVM[Oracle Corporation/OpenJDK 64-Bit Server VM/1.8.0\_131/25.131-b11]  
[2017-06-26T19:47:57,042][INFO][o.e.n.Node] [3c1b1122-c60b-452b-b323-11a5e4957a3a] JVM arguments [-XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -XX:+DisableExplicitGC, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -Djdk.io.permissionsUseCanonicalPath=true, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Dlog4j.skipJansi=true, -XX:+HeapDumpOnOutOfMemoryError, -Xms2g, -Xmx2g, -Des.path.home=/elasticsearch]  
[2017-06-26T19:47:59,184][INFO][o.e.p.PluginsService] [3c1b1122-c60b-452b-b323-11a5e4957a3a] loaded module [aggs-matrix-stats]  
[2017-06-26T19:47:59,184][INFO][o.e.p.PluginsService] [3c1b1122-c60b-452b-b323-11a5e4957a3a] loaded module [ingest-common]  
[2017-06-26T19:47:59,184][INFO][o.e.p.PluginsService] [3c1b1122-c60b-452b-b323-11a5e4957a3a] loaded module [lang-expression]  
[2017-06-26T19:47:59,184][INFO][o.e.p.PluginsService] [3c1b1122-c60b-452b-b323-11a5e4957a3a] loaded module [lang-groovy]  
[2017-06-26T19:47:59,185][INFO][o.e.p.PluginsService] [3c1b1122-c60b-452b-b323-11a5e4957a3a] loaded module [lang-mustache]  
[2017-06-26T19:47:59,185][INFO][o.e.p.PluginsService] [3c1b1122-c60b-452b-b323-11a5e4957a3a] loaded module [lang-painless]  
[2017-06-26T19:47:59,185][INFO][o.e.p.PluginsService] [3c1b1122-c60b-452b-b323-11a5e4957a3a] loaded module [percolator]  
[2017-06-26T19:47:59,185][INFO][o.e.p.PluginsService] [3c1b1122-c60b-452b-b323-11a5e4957a3a] loaded module [reindex]  
[2017-06-26T19:47:59,185][INFO][o.e.p.PluginsService] [3c1b1122-c60b-452b-b323-11a5e4957a3a] loaded module [transport-netty3]  
[2017-06-26T19:47:59,185][INFO][o.e.p.PluginsService] [3c1b1122-c60b-452b-b323-11a5e4957a3a] loaded module [transport-netty4]  
[2017-06-26T19:47:59,186][INFO][o.e.p.PluginsService] [3c1b1122-c60b-452b-b323-11a5e4957a3a] no plugins loaded  
[2017-06-26T19:48:01,828][INFO][o.e.d.DiscoveryModule] [3c1b1122-c60b-452b-b323-11a5e4957a3a] using discovery type [zen]  
[2017-06-26T19:48:03,043][INFO][o.e.n.Node] [3c1b1122-c60b-452b-b323-11a5e4957a3a] initialized  
[2017-06-26T19:48:03,044][INFO][o.e.n.Node] [3c1b1122-c60b-452b-b323-11a5e4957a3a] starting ...  
[2017-06-26T19:48:03,945][INFO][o.e.t.TransportService] [3c1b1122-c60b-452b-b323-11a5e4957a3a] publish\_address {172.17.17.2:9300}, bound\_addresses {172.17.17.2:9300}  
[2017-06-26T19:48:03,962][INFO][o.e.b.BootstrapChecks] [3c1b1122-c60b-452b-b323-11a5e4957a3a] bound or publishing to a non-loopback or non-link-local address, enforcing bootstrap checks  
ERROR: [1] bootstrap checks failed  
[1]: memory locking requested for elasticsearch process but memory is not locked  
[2017-06-26T19:48:03,979][INFO][o.e.n.Node] [3c1b1122-c60b-452b-b323-11a5e4957a3a] stopping ...  
[2017-06-26T19:48:04,143][INFO][o.e.n.Node] [3c1b1122-c60b-452b-b323-11a5e4957a3a] stopped  
[2017-06-26T19:48:04,144][INFO][o.e.n.Node] [3c1b1122-c60b-452b-b323-11a5e4957a3a] closing ...  
[2017-06-26T19:48:04,172][INFO][o.e.n.Node] [3c1b1122-c60b-452b-b323-11a5e4957a3a] closed

---

<div class="post-metadata">

**Author:** ![willJackson](https://avatars.discourse-cdn.com/v4/letter/w/958977/32.png) [@willJackson](https://discuss.elastic.co/u/willJackson)\
**Post date:** [June 26, 2017, 7:12am UTC](https://discuss.elastic.co/t/i-use-kubernetes-to-run-es-the-container-can-not-run-and-i-get-the-error-bootstrap-checks-failed-1-memory-locking-requested-for-elasticsearch-process-but-memory-is-not-locked/90786/2 "2017-06-26T07:12:38Z")

</div>

i use centos7 and use es 5.4.1,i set many parameters:  
1）/etc/security/limits.conf：

- 

```
   hard nofile 65536

```

- 

```
   soft nofile 65536

```

elasticsearch soft memlock unlimited  
elasticsearch hard memlock unlimited  
2）/etc/security/limits.d/90-nproc.conf

- soft nproc 2048  
4）/etc/sysctl.conf ：  
vm.max\_map\_count = 262144

---

<div class="post-metadata">

**Author:** ![willJackson](https://avatars.discourse-cdn.com/v4/letter/w/958977/32.png) [@willJackson](https://discuss.elastic.co/u/willJackson)\
**Post date:** [June 26, 2017, 7:16am UTC](https://discuss.elastic.co/t/i-use-kubernetes-to-run-es-the-container-can-not-run-and-i-get-the-error-bootstrap-checks-failed-1-memory-locking-requested-for-elasticsearch-process-but-memory-is-not-locked/90786/3 "2017-06-26T07:16:36Z")

</div>

when i set bootstrap.memory\_lock:false the ES can run without problems.  
what is wrong with it ?

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [June 26, 2017, 7:26am UTC](https://discuss.elastic.co/t/i-use-kubernetes-to-run-es-the-container-can-not-run-and-i-get-the-error-bootstrap-checks-failed-1-memory-locking-requested-for-elasticsearch-process-but-memory-is-not-locked/90786/4 "2017-06-26T07:26:43Z")

</div>

I remember from another thread that your kubernetes service file needs to have `IPC_LOCK` capabilities configured in order to be able to lock memory.

---

<div class="post-metadata">

**Author:** ![willJackson](https://avatars.discourse-cdn.com/v4/letter/w/958977/32.png) [@willJackson](https://discuss.elastic.co/u/willJackson)\
**Post date:** [June 26, 2017, 7:34am UTC](https://discuss.elastic.co/t/i-use-kubernetes-to-run-es-the-container-can-not-run-and-i-get-the-error-bootstrap-checks-failed-1-memory-locking-requested-for-elasticsearch-process-but-memory-is-not-locked/90786/5 "2017-06-26T07:34:49Z")

</div>

i have it in the rc file :  
capabilities:  
add:  
- IPC\_LOCK

does the error “ setting limit: Operation not permitted ” cause ？

---

<div class="post-metadata">

**Author:** ![willJackson](https://avatars.discourse-cdn.com/v4/letter/w/958977/32.png) [@willJackson](https://discuss.elastic.co/u/willJackson)\
**Post date:** [June 26, 2017, 8:24am UTC](https://discuss.elastic.co/t/i-use-kubernetes-to-run-es-the-container-can-not-run-and-i-get-the-error-bootstrap-checks-failed-1-memory-locking-requested-for-elasticsearch-process-but-memory-is-not-locked/90786/6 "2017-06-26T08:24:11Z")

</div>

what else can cause the problem?

---

<div class="post-metadata">

**Author:** ![willJackson](https://avatars.discourse-cdn.com/v4/letter/w/958977/32.png) [@willJackson](https://discuss.elastic.co/u/willJackson)\
**Post date:** [June 27, 2017, 12:09pm UTC](https://discuss.elastic.co/t/i-use-kubernetes-to-run-es-the-container-can-not-run-and-i-get-the-error-bootstrap-checks-failed-1-memory-locking-requested-for-elasticsearch-process-but-memory-is-not-locked/90786/7 "2017-06-27T12:09:55Z")

</div>

finally i solve it .it is the kubernetes make the problem .add  
securityContext:  
privileged: true  
capabilities:  
add:  
- IPC\_LOCK  
to your rc file ,and you must make your api-server configfile the privileged=true too .  
then you can run es successfully

---

<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:** [July 25, 2017, 12:10pm UTC](https://discuss.elastic.co/t/i-use-kubernetes-to-run-es-the-container-can-not-run-and-i-get-the-error-bootstrap-checks-failed-1-memory-locking-requested-for-elasticsearch-process-but-memory-is-not-locked/90786/8 "2017-07-25T12:10:05Z")

</div>

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