vfarcic / docker-flow-stacks

85 stars 60 forks source link

Elastic search memory locking not supported from swarm? #18

Closed masonb81 closed 6 years ago

masonb81 commented 6 years ago

Hi Victor,

I'm attempting to run an ELK stack and deploy using docker stack deploy how ever it's complaining that its unable to allocate the memory. Solutions have advised to use the ulimits (memlock) .. option which works if you just do a docker-compose up but won't work through docker stack deploy as docker advises that ulimits aren't supported by docker swarm. Any ideas how to make the stack work in swarm? Mainly I want to get Kibana as a docker service and put it behind our DFP.

Thanks in advance. Mason

Logging_elasticsearch.1.m7q7t895wy6f@privxidaas | [2018-03-30T20:26:03,547][WARN ][o.e.b.JNANatives ] Unable to lock JVM Memory: error=12, reason=Cannot allocate memory Logging_elasticsearch.1.m7q7t895wy6f@privxidaas | [2018-03-30T20:26:03,568][WARN ][o.e.b.JNANatives ] This can result in part of the JVM being swapped out. Logging_elasticsearch.1.m7q7t895wy6f@privxidaas | [2018-03-30T20:26:03,568][WARN ][o.e.b.JNANatives ] Increase RLIMIT_MEMLOCK, soft limit: 65536, hard limit: 65536 Logging_elasticsearch.1.m7q7t895wy6f@privxidaas | [2018-03-30T20:26:03,569][WARN ][o.e.b.JNANatives ] These can be adjusted by modifying /etc/security/limits.conf, for example: Logging_elasticsearch.1.m7q7t895wy6f@privxidaas | # allow user 'elasticsearch' mlockall Logging_elasticsearch.1.m7q7t895wy6f@privxidaas | elasticsearch soft memlock unlimited Logging_elasticsearch.1.m7q7t895wy6f@privxidaas | elasticsearch hard memlock unlimited Logging_elasticsearch.1.m7q7t895wy6f@privxidaas | [2018-03-30T20:26:03,569][WARN ][o.e.b.JNANatives ] If you are logged in interactively, you will have to re-login for the new limits to take effect. Logging_elasticsearch.1.m7q7t895wy6f@privxidaas | [2018-03-30T20:26:04,478][INFO ][o.e.n.Node ] [] initializing ... Logging_elasticsearch.1.m7q7t895wy6f@privxidaas | [2018-03-30T20:26:04,735][INFO ][o.e.e.NodeEnvironment ] [rdGPLKS] using [1] data paths, mounts [[/usr/share/elasticsearch/data (/dev/vda1)]], net usable_space [105.5gb], net total_space [116.2gb], types [ext4] Logging_elasticsearch.1.m7q7t895wy6f@privxidaas | [2018-03-30T20:26:04,735][INFO ][o.e.e.NodeEnvironment ] [rdGPLKS] heap size [495.3mb], compressed ordinary object pointers [true] Logging_elasticsearch.1.m7q7t895wy6f@privxidaas | [2018-03-30T20:26:04,737][INFO ][o.e.n.Node ] node name [rdGPLKS] derived fro...

version: '3.4' services:

elasticsearch: image: docker.elastic.co/elasticsearch/elasticsearch-oss:6.2.3 container_name: elasticsearch environment:

masonb81 commented 6 years ago

I used the provided template here with the newer image versions and it has worked, must have been a coding error in my script anyway it seems to work just fine.