Elasticsearch docker-compose and CLI settings


(Steve Malenfant) #1

I'm trying to use docker-compose to start a small cluster for testing, although I'm having problem passing more than 1 Setting on the command line. How do we specify multiple "Configure a setting" ?

es_master | starts elasticsearch
es_master |
es_master | Option Description
es_master | ------ -----------
es_master | -E Configure a setting
es_master | -V, --version Prints elasticsearch version information and exits
es_master | -d, --daemonize Starts Elasticsearch in the background
es_master | -h, --help show help
es_master | -p, --pidfile Creates a pid file in the specified path on start
es_master | -q, --quiet Turns off standard ouput/error streams logging in console
es_master | -s, --silent show minimal output
es_master | -v, --verbose show verbose output
es_master | ERROR: Positional arguments not allowed, found [node.name=docker-es-master]

docker-compose.yml

version: '2'

services:
master:
container_name: es_master
image: elasticsearch:5.0.0-rc1
#command: elasticsearch –E network.host=0.0.0.0,node.master=true,cluster.name=docker-cluster,node.name="Elastic Master"
command: [elasticsearch, -E, node.master=true, node.name=docker-es-master]

volumes:
  - ./master:/usr/share/elasticsearch/data
ports:
  - "9200:9200"
  - "9300:9300"
restart: always

node:
container_name: es_node
image: elasticsearch:5.0.0-rc1
#command: elasticsearch –E network.host=0.0.0.0,cluster.name=docker-cluster,discovery.zen.ping.unicast.hosts=es_master
command: elasticsearch -Ediscovery.zen.ping.unicast.hosts=es_master
volumes:
- ./node:/usr/share/elasticsearch/data
depends_on:
- master
links:
- master:es_master
restart: always


(Ed) #2

https://www.elastic.co/guide/en/elasticsearch/reference/2.3/setup-configuration.html#styles

why not just write a config file if your statically setting the cluster , name etc.

but you probably have to just specify a -E for each value your setting

-E network.host=..... -E cluster.name=......


(system) #3