Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to do a simple edit in elasticsearch.yml in a docker container?

I am using docker-compose as in https://github.com/davidefiocco/dockerized-elasticsearch-indexer/blob/master/docker-compose.yml to initialize a containerized elasticsearch index.
Now, I would like to set a larger value for indices.query.bool.max_clause_count than the default setting using a elasticsearch.yml config file (this is to run some heavy queries as in Elasticsearch - set max_clause_count).

So far I tried to add in the docker-compose.yml a volume with:

services:
   elasticsearch:
      volumes:
        - ./elasticsearch/config/elasticsearch.yml

(and variations thereof) trying to point to a elasticsearch.yml file (that I would like to ship with the rest of the files) with the right max_clause_count setting, but to no avail.

Can someone point me to the right direction?

like image 957
Davide Fiocco Avatar asked Apr 10 '18 10:04

Davide Fiocco


People also ask

Where is the Elasticsearch yml file in Docker?

It is located in the /usr/share/elasticsearch/config .


1 Answers

You can mount the host's directory containing the elasticsearch.yml into the container using

services:
   elasticsearch:
      volumes:
        - path_to/custom_elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml:ro
like image 139
Shoan Avatar answered Sep 28 '22 05:09

Shoan