Reputation:
I am getting this error:
es01 | {"type": "server", "timestamp": "2019-09-18T17:31:42,267+0000", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "es01", "message": "starting ..." } es01 | {"type": "server", "timestamp": "2019-09-18T17:31:42,709+0000", "level": "INFO", "component": "o.e.t.TransportService", "cluster.name": "docker-cluster", "node.name": "es01", "message": "publish_address {172.21.0.3:9300}, bound_addresses {0.0.0.0:9300}" } es01 | {"type": "server", "timestamp": "2019-09-18T17:31:42,760+0000", "level": "INFO", "component": "o.e.b.BootstrapChecks", "cluster.name": "docker-cluster", "node.name": "es01", "message": "bound or publishing to a non-loopback address, enforcing bootstrap checks" }
the error that matters:
ERROR: [1] bootstrap checks failed es01 | [1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
and then the node stops because of the above error:
es01 | {"type": "server", "timestamp": "2019-09-18T17:31:42,810+0000", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "es01", "message": "stopping ..." } es01 | {"type": "server", "timestamp": "2019-09-18T17:31:42,904+0000", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "es01", "message": "stopped" } es01 | {"type": "server", "timestamp": "2019-09-18T17:31:42,905+0000", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "es01", "message": "closing ..." } es01 | {"type": "server", "timestamp": "2019-09-18T17:31:42,967+0000", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "es01", "message": "closed" } es01 | {"type": "server", "timestamp": "2019-09-18T17:31:42,976+0000", "level": "INFO", "component": "o.e.x.m.p.NativeController", "cluster.name": "docker-cluster", "node.name": "es01", "message": "Native controller process has stopped - no new native processes can be started" }
my docker-compose.yml file is as follows:
version: '2.2'
services:
kibana:
depends_on:
- es01
- es02
image: docker.elastic.co/kibana/kibana:7.3.1
container_name: kibana
ports:
- 5601:5601
environment:
ELASTICSEARCH_HOSTS: http://es01:9200
ELASTICSEARCH_URL: http://es01:9200
es01:
image: docker.elastic.co/elasticsearch/elasticsearch:7.3.1
container_name: es01
environment:
- node.name=es01
- discovery.seed_hosts=es02
- cluster.initial_master_nodes=es01,es02
- cluster.name=docker-cluster
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- esdata01:/usr/share/elasticsearch/data
ports:
- 9200:9200
- 9300:9300
es02:
image: docker.elastic.co/elasticsearch/elasticsearch:7.3.1
container_name: es02
environment:
- node.name=es02
- discovery.seed_hosts=es01
- cluster.initial_master_nodes=es01,es02
- cluster.name=docker-cluster
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- esdata02:/usr/share/elasticsearch/data
volumes:
esdata01:
driver: local
esdata02:
driver: local
does anyone know how I can increase the memory of the cluster and fix the error?
Upvotes: 34
Views: 67814
Reputation: 12258
If you closely follow the official Elasticsearch Docker documentation.
You need to set the vm.max_map_count
check this here.
Upvotes: 29
Reputation:
looks like the solution is to use: https://github.com/docker-library/elasticsearch/issues/111
which suggests running this on ubuntu:
sudo sysctl -w vm.max_map_count=262144
Upvotes: 63