Using official Elasticsearch container elasticsearch.
Copy docker-compose.elasticsearch.yaml to your project's .ddev folder.
From within the container, the elasticsearch container is reached at hostname: elasticsearch, port: 9200, so the server URL might be http://elasticsearch:9200
.
You can access the Elasticsearch server directly from the host for debugging purposes by visiting http://<DDEV_SITENAME>.ddev.site:9200
This configuration limits memory usage to 512mb. This should be enough for most projects, but if your elasticsearch
service stops with no obvious reason, increase your docker max memory or/and the service max memory.
You can use ddev logs -s elasticsearch
to investigate what the elasticsearch daemon has been up to, or if you have a RAM-related crash.
- There are two related answers to the Stack Overflow question on ddev and Elasticsearch.
- @juampynr's Lullabot article on Drupal 8 and Elasticsearch is helpful for Drupal users.