0

I was using "rsync" as the wsrep_sst_method in my galera.cnf files on 3-Node Galera Cluster. When it was so, the system served when there was at least 2 active node. So when any two node were gone, the active one did not serve. It was good enough but when I upgraded the system and assigned the wsre_sst_method = mariabackup, it is serving if there is any active node. So when any of two nodes are gone, it is not preventing the working of the last active node. I dont want system works when there is only one active node. I want the system work like before upgrading without changing the wsrep_sst_method.

So the problem is simple. How can I prevent the system serving when there is just one active node?

2 Answers 2

0

simply check status variable named as "wsrep_cluster_size" as long as there is Primary Component at the cluster (you may also check "wsrep_cluster_status") all other down node will catch up when they are alive.

you may use cron job to check within interval time if the wsrep_cluster_size reach specific values. you can also halt of your app if that happened.

1

Changing the wsrep_sst_method does not change this behaviour - it all depends on whether the remaining node thinks it's the primary partition or not. A partition is the segment of cluster members that can talk to each other.

The cluster knows how many members it should have currently and if any member leaves or joins it updates its internal map of members. A cluster can either be considered members of a primary or non-primary cluster and this is decided by a quorum vote between all members of that partition.

This document (https://galeracluster.com/2015/08/the-primary-component-in-galera-cluster/) explains it properly, but the short version is that if a node is part of the largest cluster possible when a split happens, that cluster will be considered to be primary, and the smaller cluster will be non-primary.

If a node thinks it's part of a non-primary cluster it will stop accepting reads or writes to non-system data to avoid a split-brain problem.

See also: https://severalnines.com/database-blog/galera-cluster-recovery-101-deep-dive-network-partitioning

3
  • @PhillSumner so you are saying that it can not be changed? Commented Oct 14, 2021 at 8:27
  • I am saying that it is possible to run a 1-node Galera cluster - I've done it recently due to 2 nodes failing in a 3-node cluster! However you have to do it in a controlled manner - take down node 3, then node 2, and node 1 should continue running. Commented Oct 14, 2021 at 8:48
  • @PhillSumner but I want the node not contiune. I will take down node3, then node 2 and node 1 must not work, I am asking how to do that, how to block the node 1 working in this situation? Commented Oct 14, 2021 at 10:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.