Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Add Elasticsearch to Mesh Docker image #348
Gentics Mesh Version, operating system, or hardware.
Embedded Elasticsearch installation gets extracted from Mesh jar on start if it it not there. If Docker container gets relocated to a different node say by Kubernetes scheduler or Docker Swarm it will force extraction again and the index data is lost.
It is possible to mitigate this by configuring ElasticSearch to use Docker volume for data and configs but it seems that extraction step is redundant.
Expected behaviour and actual behaviour
Elasticsearch instalation is part of Mesh Docker image with default configuration using /config for ES confs and /data for index
@afilimonov I recommend to run ES in a dedicated container. You can easily set the env:
Another option would be to add another volume for /mesh/elasticsearch. In that case the ES and the data gets preserved and no issue arises.
Yes dedicated ES is preferred option and that is what we use. However for quick starts or personal dev environment having all in one Docker image is really handy. Mounting/mesh/elasticsearch does work it seems to be un-Dockerish solution. I'd prefere to have an immutable Docker image with everything that is needed included. Also ES doesn't really like to star from a mounted NFS drive you have to bump up ES startup timeout to make it work.
For embedded ES we use custom startup parameters that point to a mounted elasticsearch.yml with index data on the mounted data volume.
@afilimonov Okay. Dev environment is a good point. I'll see what I can do about the mountpoint. Maybe I can setup the data folder for the embedded ES at a different location and provide a volume (e.g. /searchindex) or something similar.
Keep in mind that Elasticsearch really does not like NFS. We had a lot of trouble with NFS in the past.
@afilimonov I like this approach (untested):
That way the ES can quickly be updated.