Hello , im facing an issue with swarm i set 3 managers and 1 worker in order to deploy a zabbix server ,
When i join tge nodes everything is okay , but when i use docker stack deploy - c compose file yml
I go check with docker node ls i got this error and nothing work i got this error :
Error response from daemon: rpc error: code = Unknown desc = The swarm does not have a leader. It’s possible that too few managers are online. Make sure more than half of the managers are online
If use docker stack without joining the nodes its works normally , but if add nodes and do the stack i got the error
It appears that your swarm cluster is headless, as in not able to establish quorum and therefor can not determine cluster state or perform changes on cluster state.
Never use an even number of manager nodes:
3 manager nodes: 1 unhealthy manager node can be compensated, You need two healthy nodes for quorum.
4 manager nodes: 1 unhealthy manager node can be compensated. You need three healthy nodes for quorum.
5 manager nodes: 2 unhealthy manager nodes can be compensated. You need three healthy nodes for quorum.
** Error response from daemon: rpc error: code = Unknown desc = The swarm does not have a leader. It’s possible that too few managers are online. Make sure more than half of the managers are online**
i tried now and it seems to be working i made 4 managers , i have no errors the servers is working ,
except one thing every one service from the compose file is on one manager is it normal !
i was expecting all services runinng in all managers node for exemple :
node 1 (zabbix server + db + agent + web int)
node 2 (zabbix server + db + agent + web int ) etc …
I am not going to discuss whether it would make sense to use 4 manager nodes or not… I would use 3 manager nodes + a worker node instead. I described why 4 manager nodes has no advantage over a 3 manager node cluster.
You can use node labels use the node labels in your placement constraints to pin services to specific nodes. The forum search should yield plenty of examples for how it’s used.
You last question shows that you didn’t understand what I wrote about unhealty/healty nodes and the quorum. A turned off is treated like an unhealthy node. Deployed Containers of swarm services will keep running, even if the cluster becomes headless. They just won’t restart if a service dies and needs to schedule a new instance.