Common failures and how to resolve them.
Symptom: docker compose ps shows Exited; logs mention
max virtual memory areas vm.max_map_count [65530] is too low.
Fix:
./scripts/setup-host.sh # or: sudo sysctl -w vm.max_map_count=262144
docker compose up -dCause: Elasticsearch is still booting (first start takes 30–60 s), or the container isn't healthy yet.
Fix:
docker compose ps # wait for STATUS = healthy
docker compose logs -f elasticsearch # watch for "started"Cause: NestJS is configured with the in-Docker hostname.
- node: 'http://elasticsearch:9200' # only works INSIDE Docker network
+ node: 'http://localhost:9200' # correct for a host-local processNestJS runs on the host, so it must use localhost.
This is normal and healthy on a single node — replica shards can't be allocated because there's only one node. Your data is fully available. No action needed.
To silence it on a specific index (optional), set replicas to 0:
curl -XPUT localhost:9200/my-index/_settings \
-H 'Content-Type: application/json' \
-d '{"index":{"number_of_replicas":0}}'red means at least one primary shard is unavailable. On a single-node dev
box the usual causes are:
curl 'localhost:9200/_cat/allocation?v' # check disk.percent
df -h # free space on the Docker diskFree up disk space, or release the read-only block after cleanup:
curl -XPUT 'localhost:9200/_all/_settings' \
-H 'Content-Type: application/json' \
-d '{"index.blocks.read_only_allow_delete": null}'curl 'localhost:9200/_cluster/allocation/explain?pretty' # diagnoseIf a dev index is unrecoverable and disposable, delete it:
curl -XDELETE localhost:9200/<broken-index>Last resort (wipes all data):
docker compose down -v && docker compose up -ddocker inspect -f '{{.RestartCount}}' elasticsearch
docker compose logs --tail=50 elasticsearchMost common causes: vm.max_map_count not set, or the host killed the container
under memory pressure. Verify the kernel param and that nothing else is starving
RAM (see PERFORMANCE.md).
- Run
docker stats elasticsearch— confirm it's within ~1.5 GB. - Ensure
bootstrap.memory_lock=trueis active (no swapping). - Lower the heap for your machine (see the table in PERFORMANCE.md).
The memlock ulimit didn't apply. Confirm the ulimits block is present in
docker-compose.yml:
ulimits:
memlock:
soft: -1
hard: -1Then recreate: docker compose up -d --force-recreate.