docker-elk: 7.2.0 fails to start on docker-swarm
Problem description
Yesterday I have started working on ELK version upgrade (6.5.4 to 7.2.0).
Sadly, I came across a lot of problems.
I am deploying this solution on docker-swarm, making the relevant changes
(like: discovery.zen.ping.unicast.hosts: tasks.elasticsearch , discovery.type: zen).
I have noticed that some mandatory configurations were added after version 7 like ‘cluster.initial_master_nodes’, making me a hard time to work on swarm mode.
I discovered that when I have received this message:
"master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and [cluster.initial_master_nodes] is empty on this node: have discovered []... "
This results with: ‘MasterNotDiscoveredException: null’.
Which then led me to Bootstrapping a cluster article, where this error is mentioned.
I can’t find a smart way to make my ELK cluster working in swarm mode at 7.2.0 version. Did anyone make that upgrade and managed to stay alive?
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 1
- Comments: 33 (1 by maintainers)
Commits related to this issue
- Set discovery.type option in Compose file for easier override ref. #410 — committed to deviantony/docker-elk by antoineco 5 years ago
- Set discovery.type option in Compose file for easier override ref. #410 — committed to deviantony/docker-elk by antoineco 5 years ago
- Set discovery.type option in Compose file for easier override ref. #410 — committed to bleed2002/docker-elk by antoineco 5 years ago
- Set discovery.type option in Compose file for easier override ref. #410 — committed to DanBrown47/docker-elk by antoineco 5 years ago
A possible solution to this issue, which I haven’t tested yet:
{{.Task.Slot}}supposedly contains the indice part of{{.Task.Name}}. E.g.2when Task.Name ==elk_elasticsearch.2.p8d7aufb80h.I’ll try to find time to validate this today or tomorrow.
edit: It works! 🎉 cc @rong0312 @saifat29 @ranjithvaddepally
As @antoineco stated above, I think it makes more sense to use
tasks.elasticsearchinstead ofelasticsearchin thediscovery.seed_hostsproperty. Even better, issuing a DNS lookup ontasks.elasticsearchand use that as the property value.By using the service name
elasticsearchit will use the virtual IP associated to the service, returning the IP associated to one of the service task (load balanced).See the Container discovery section in https://docs.docker.com/network/overlay/