Hello there !
On Docker, I can't succeed to have a dedicated master node in a simple 4 nodes test setup.
Master is never discovered when I use :
version: '2.2'
services:
master1:
image: docker.elastic.co/elasticsearch/elasticsearch:7.4.2
container_name: master1
environment:
- node.name=master1
- cluster.name=es-docker-cluster
- node.master=true
- discovery.seed_hosts=es01,es02,es03
- cluster.initial_master_nodes=master1,es01,es02,es03
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- master1:/usr/share/elasticsearch/data
networks:
- elastic
es01:
depends_on:
- master1
image: docker.elastic.co/elasticsearch/elasticsearch:7.4.2
container_name: es01
environment:
- node.name=es01
- cluster.name=es-docker-cluster
- node.master=false
- discovery.seed_hosts=es02,es03,master1
- cluster.initial_master_nodes=master1,es01,es02,es03
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- data01:/usr/share/elasticsearch/data
ports:
- 9200:9200
networks:
- elastic
es02:
depends_on:
- master1
image: docker.elastic.co/elasticsearch/elasticsearch:7.4.2
container_name: es02
environment:
- node.name=es02
- cluster.name=es-docker-cluster
- node.master=false
- discovery.seed_hosts=es01,es03,master1
- cluster.initial_master_nodes=master1,es01,es02,es03
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- data02:/usr/share/elasticsearch/data
networks:
- elastic
es03:
depends_on:
- master1
image: docker.elastic.co/elasticsearch/elasticsearch:7.4.2
container_name: es03
environment:
- node.name=es03
- cluster.name=es-docker-cluster
- node.master=false
- discovery.seed_hosts=es01,es02,master1
- cluster.initial_master_nodes=master1,es01,es02,es03
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- data03:/usr/share/elasticsearch/data
networks:
- elastic
volumes:
data01:
driver: local
data02:
driver: local
data03:
driver: local
master1:
driver: local
networks:
elastic:
driver: bridge
If I remove node.master and node.data settings, it works, but using a random node as master
version: '2.2'
services:
master1:
image: docker.elastic.co/elasticsearch/elasticsearch:7.4.2
container_name: master1
environment:
- node.name=master1
- cluster.name=es-docker-cluster
- discovery.seed_hosts=es01,es02,es03
- cluster.initial_master_nodes=master1,es01,es02,es03
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- master1:/usr/share/elasticsearch/data
networks:
- elastic
es01:
depends_on:
- master1
image: docker.elastic.co/elasticsearch/elasticsearch:7.4.2
container_name: es01
environment:
- node.name=es01
- cluster.name=es-docker-cluster
- discovery.seed_hosts=es02,es03,master1
- cluster.initial_master_nodes=master1,es01,es02,es03
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- data01:/usr/share/elasticsearch/data
ports:
- 9200:9200
networks:
- elastic
es02:
depends_on:
- master1
image: docker.elastic.co/elasticsearch/elasticsearch:7.4.2
container_name: es02
environment:
- node.name=es02
- cluster.name=es-docker-cluster
- discovery.seed_hosts=es01,es03,master1
- cluster.initial_master_nodes=master1,es01,es02,es03
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- data02:/usr/share/elasticsearch/data
networks:
- elastic
es03:
depends_on:
- master1
image: docker.elastic.co/elasticsearch/elasticsearch:7.4.2
container_name: es03
environment:
- node.name=es03
- cluster.name=es-docker-cluster
- discovery.seed_hosts=es01,es02,master1
- cluster.initial_master_nodes=master1,es01,es02,es03
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- data03:/usr/share/elasticsearch/data
networks:
- elastic
volumes:
data01:
driver: local
data02:
driver: local
data03:
driver: local
master1:
driver: local
networks:
elastic:
driver: bridge
Elasticsearch error message : https://pastebin.com/4WUqwz4T
Any idea on why it don't accept the settings ?
Thanks for your help !