Questions tagged [leader-election]
55 questions
11
votes
0 answers
Picking between Redisson and Lettuce for Redis with clustered-setup
I am considering Lettuce and Redisson java clients for use in my application server (to connect to Redis). I haven't been able to find a proper comparison of the two from people who have tried them both or one of them in a single common place. The…

Shabirmean
- 2,341
- 4
- 21
- 34
7
votes
3 answers
Why is it recommended to create clusters with odd number of nodes
There are several resources about distributed systems, like the mongo db documentation that recommend odd number of nodes in a cluster.
What are the benefits of having odd number of nodes?

ProgramCpp
- 1,280
- 2
- 15
- 26
4
votes
1 answer
Why Raft should grant vote when voteFor is candidateId?
I am not sure if I understand the RequestVote RPC detail in Raft correctly.
In the paper, it says
Receiver implementation:
1. Reply false if term < currentTerm (§5.1)
2. If votedFor is null or candidateId, and candidate’s log is at least as…

pikatao
- 344
- 6
- 12
3
votes
1 answer
Understanding etcd Leader election APIs
I am trying to understand various functions provided by etcd election api and what they mean semantically.
In their official documentation very briefly mentioned about what each function does, and no examples are provided.
For example we have…

greendragons
- 85
- 6
3
votes
3 answers
leader not electing hyperLedger fabric raft ordering service
When i try to deploy fabric-raft ordering service, it shows these logs. it starts election repetitively without electing a leader. i tried changing heartbeat time to 1 sec and election time to 10 sec but that is not working. then i tried to…

xama arshad
- 31
- 1
2
votes
1 answer
Leaderelections failing, lease unable to be renewed automatically
I have a production cluster is currently running on K8s version 1.19.9, where the kube-scheduler and kube-controller-manager failed to have leader elections. The leader is able to acquire the first lease, however it then cannot renew/reacquire the…

janeosaka
- 35
- 6
2
votes
0 answers
Is there a way to use Kubernetes LeaderElection across multiple clusters?
We are using the native Kubernetes LeaderElection, but it appears to only work within the cluster. Is there a way to make this work across multiple clusters?
Official Client:…

Don Rhummy
- 24,730
- 42
- 175
- 330
2
votes
0 answers
How to execute functions once pod is elected leader by using leader-with-lease in operator-framework?
I am trying to run 3 pods/replicas of a container in which I want one of them to be run as the leader and if that particular pod is stopped or fails, immediately the other non-leader running pods should take the leadership to continue execution that…

Yashgiri Goswami
- 181
- 3
- 15
2
votes
1 answer
Kubernetes services for all pods and another for only the leader
In Kubernetes, is it possible to have 2 services for a single deployment, one which is "standard" and proxies in front of all ready pods, and a second service which sends traffic only the elected leader? If so how? I am using client-go for leader…

user2133814
- 2,431
- 1
- 24
- 34
2
votes
2 answers
Java leader election using Zookeeper
I read about Java leader election implementation using Zookeeper. I am clear with the algorithm described here. But I have a subtle question to ask about the algorithm.
In the algorithm explained, nodes select all the child nodes of the "/election"…

wmIbb
- 125
- 1
- 4
- 19
2
votes
1 answer
paxos for system builder
Why a separate phase of Leader Election is required in the paper Paxos for System Builders: An Overview instead of using the prepare phase for the leader election? What advantages does this additional phase provide over using the implicit prepare…

vaibhav
- 21
- 1
1
vote
0 answers
How to handle loss of Event in Custom Controller in K8s
We have implemented a custom controller in kubernetes, which kind is Pod using the kubebuilder tool. This controller is listening for the Pod event in namespace Queue on pods with label of router.
mgr, err :=…

Ashutosh Pandey
- 120
- 8
1
vote
1 answer
How is Apache Camel making sure there are no two masters?
My starting point is the actually the outbox pattern.
To make sure the message in an outbox in only relayed once we only have one replica of the outbox service available in our k8s cluster. To be super sure, the deployment strategy of this service…

Moritz Schmitz v. Hülst
- 3,229
- 4
- 36
- 63
1
vote
1 answer
Is leader election used for active/partial standby use cases for microservice replicas?
For microservice HA, I know there's the "Active/Active" configuration as well as the "Active/Standby" configuration.
I'm wondering if you might use Leader Election for something in the middle. For example, say there are 3 microservices which all…

vmayer
- 985
- 2
- 9
- 18
1
vote
2 answers
Kubernetes cluster agent: Could not construct reference to ConfigMap
ConfigMap exists in the right namespace, but getting this error that it couldn't construct reference to configmap, and did not get a confirmation that leaderelection has been successfully required. Any advice would be appreciated
error log…

yunlee
- 69
- 3
- 10