Max virtual memory areas .max_map_count [65530] is too low

Hi,

I am new to Opendistro for Elasticsearch and tried to do the first steps as described in Get Up and Running with Open Distro for Elasticsearch | AWS Open Source Blog

When I used the default docker-compose file there were several errors. So I decided to remove the 2nd Elasticsearch and the Kibana node. This is my docker-compse file.

version: ‘3’
services:
odfe-node1:
image: amazon/opendistro-for-elasticsearch:0.7.0
container_name: odfe-node1
environment:
- cluster.name=odfe-cluster
- bootstrap.memory_lock=true # along with the memlock settings below, disables swapping
- “ES_JAVA_OPTS=-Xms512m -Xmx512m” # minimum and maximum Java heap size, recommend setting both to 50% of system RAM
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- odfe-data1:/usr/share/elasticsearch/data
ports:
- 9200:9200
- 9600:9600 # required for Performance Analyzer
networks:
- odfe-net
volumes:
odfe-data1:

networks:
odfe-net:

When I start the container with ‘sudo docker-compose up’ (I need to use sudo because the docker-daemon is started as user root) Elasticsearch does not start beacuse of the following error:

odfe-node1 | [2019-03-27T08:56:53,596][INFO ][o.e.b.BootstrapChecks ] [TASvLBx] bound or publishing to a non-loopback address, enforcing bootstrap checks
odfe-node1 | ERROR: [1] bootstrap checks failed
odfe-node1 | [1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

How can I increase the virtual memory for Elasticseach in the docker container?

Thanx for help in advance!

Martin

You don’t need to increase the virtual memory for Elasticsearch at container level, you can do it for the host machine by running this command:

sudo sysctl -w vm.max_map_count=262144

and then restart your docker-containers.

The command

solved the problem.

Thank you!

Even i am getting same error, I have deployed Elastic search 7.8.0 on AKS and getting same error.

ERROR: [2] bootstrap checks failed
[1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
[2]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers,
cluster.initial_master_nodes] must be configured

Below are my yml file

apiVersion: apps/v1
kind: Deployment
metadata:
name: elastic
namespace: cam-ee
spec:
replicas: 1
selector:
matchLabels:
app: elastic
template:
metadata:
labels:
app: elastic
spec:
containers:

  • name: elasticsearch
    image: X.X.X.X:8085/elasticsearch:7.8.0
    ports:
  • containerPort: 9200
  • containerPort: 9300

Pls do the needful.
Sanjeev Kumar N