Demos and production are different sports. This checklist covers what changes when Elasticsearch has to be reliable, secure and observable under real load.
Security and reliability defaults
- Enable security (TLS + auth); never expose 9200 publicly
- Use role-based access and API keys
A production-minded config
Create an index with an explicit mapping.
curl -X PUT localhost:9200/logs -H 'Content-Type: application/json' -d '{
"mappings": { "properties": {
"@timestamp": { "type": "date" },
"level": { "type": "keyword" },
"message": { "type": "text" }
} }
}'Operational best practices
- Define explicit mappings; disable dynamic where possible
- Use Index Lifecycle Management for retention/rollover
- Size shards deliberately (tens of GB each)
In production, boring and reproducible beats clever every time.
Want senior help putting Elasticsearch to work - or a team bootcamp on it? CodeWizard runs Israel's largest DevOps community and embeds named senior engineers with a transparent hours log. Book a free consult or explore the Academy.