Skip to content

ddev/ddev-elasticsearch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

add-on registry tests last commit release

DDEV Elasticsearch

Overview

Elasticsearch is an open source distributed, RESTful search and analytics engine, scalable data store, and vector database capable of addressing a growing number of use cases.

This add-on integrates Elasticsearch into your DDEV project.

Installation

ddev add-on get ddev/ddev-elasticsearch
ddev restart

After installation, make sure to commit the .ddev directory to version control.

Using Elasticsearch 8

ddev add-on get ddev/ddev-elasticsearch
cp .ddev/elasticsearch/docker-compose.elasticsearch8.yaml .ddev/
ddev restart

Switching between Elasticsearch 7 and 8

All Elasticsearch data is stored in a Docker volume, so if you're switching versions or setups, you may want to start fresh by removing the volume:

# remove old elasticsearch volume (if this is downgrade)
ddev stop
docker volume rm ddev-$(ddev status -j | docker run -i --rm ddev/ddev-utilities jq -r '.raw.name')_elasticsearch

Usage

To access the Elasticsearch container from within the web container, use the hostname elasticsearch and port 9200. For example, the server URL might be http://elasticsearch:9200. Alternatively, you can use the ddev.site URLs to access it via HTTP or HTTPS: http://<projectname>.ddev.site:9200 and https://<projectname>.ddev.site:9201. These URLs are also available from the host.

Tip

What about Kibana support? Use this add-on.

Advanced Customization

Avoid modifying the provided docker-compose.elasticsearch.yaml file. Instead, create a docker-compose.elasticsearch_extras.yaml file for any customizations. For more information on defining additional services with Docker Compose, please refer to the official DDEV documentation.

Minor Version Bump

To change the minor version of Elasticsearch:

ddev dotenv set .ddev/.env.elasticsearch --elasticsearch-docker-image=elasticsearch:7.17.14
ddev restart

Make sure to commit the .ddev/.env.elasticsearch file to version control.

Memory Limit

By default, this configuration limits the memory usage of the elasticsearch service to 512MB. This should be sufficient for most projects. However, if the service stops unexpectedly, you may need to increase the maximum memory allocation for Docker and/or the elasticsearch service. To do so, modify the ES_JAVA_OPTS environment variable in the docker-compose.elasticsearch_extras.yaml file.

Example for 2GB:

services:
  elasticsearch:
    environment:
      - "ES_JAVA_OPTS=-Xms2g -Xmx2g"

You can use ddev logs -s elasticsearch to investigate the Elasticsearch daemon's activity or to troubleshoot RAM-related crashes.

Additional Resources

Credits

Originally Contributed by dacostafilipe with contributions by @Morgy93, @amitaibu, @aronnovak and others

Maintained by @aronnovak

About

Elasticsearch full-text search and analytics engine for DDEV

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Contributors 6

Languages