Skip to content

Commit bbbd247

Browse files
authored
ElasticSearch instance fails at loading (wrong)
ElasticSearch (ES from now onwards) will fail to initialize since the parameters for its environment are not correct or absent. These are: * `cluster.name`: Name of the cluster itself * `bootstrap.memory_lock`: Needed for ES to [lock the JVM into swap instead of memory](https://www.elastic.co/guide/en/elasticsearch/reference/master/_memory_lock_check.html). * `"ES_JAVA_OPTS=-Xms256m -Xmx256m"`: [Initial and maximum HEAP size for JVM](https://www.elastic.co/guide/en/elasticsearch/reference/current/_heap_size_check.html). Since it's locked to disk, should be the same. Half the defaults (512m) for development. * `ulimits: memlock: soft (-1), hard (-1)`: [ES needs to have unlimited access to memory](https://www.elastic.co/guide/en/elasticsearch/reference/current/max-size-virtual-memory-check.html), otherwise it will feel sluggish. * `mem_limit: 512m`: Hard limit the memory available for the container. This can, and should, be changed using `.env` file variables, but it seems that this should suffice for basic ES development.
1 parent c35445b commit bbbd247

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

docker-compose.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,15 @@ services:
473473
volumes:
474474
- elasticsearch-data:/usr/share/elasticsearch/data
475475
- elasticsearch-plugins:/usr/share/elasticsearch/plugins
476+
environment:
477+
- cluster.name=laradock-cluster
478+
- bootstrap.memory_lock=true
479+
- "ES_JAVA_OPTS=-Xms256m -Xmx256m"
480+
ulimits:
481+
memlock:
482+
soft: -1
483+
hard: -1
484+
mem_limit: 512m
476485
ports:
477486
- "${ELASTICSEARCH_HOST_HTTP_PORT}:9200"
478487
- "${ELASTICSEARCH_HOST_TRANSPORT_PORT}:9300"

0 commit comments

Comments
 (0)