Run elasticsearch in docker
Posted on 01 Jun 2025
If you’re running Elasticsearch in Docker locally, you might encounter a frustrating issue where your cluster suddenly goes into a red (unhealthy) state, even though everything seems fine. This often happens when your local disk usage exceeds 90%. I tend to mount the elasticsearch data directory into my host file system to preserve data. version: "3.9" services: elasticsearch: image: elasticsearch:9.0.2 environment: - discovery.type=single-node - ES_JAVA_OPTS=-Xms1g -Xmx1g - xpack.security.enabled=false volumes: - ./es_data:/usr/share/elasticsearch/data ports: - target: 9200...