Quorum in XtraDB Cluster

  • Filter
  • Time
  • Show
Clear All
new posts

  • Quorum in XtraDB Cluster

    I read somewhere that you should always have an odd number of nodes in your cluster, because of the galera quorum mechanism.

    How does this work in XtraDB Cluster.

    I want to have an 8 node cluster, with 4 nodes in each datacentre.
    HAproxy on each webserver (which are also split across datacentres) will balance the load across the cluster.
    But the likely scenario is that 4 servers will 'disappear' if one datacentre 'goes down'. This means that there will still be an even number of nodes remaining. Will the XtraDB cluster handle this gracefully? And how would it work? Or do I need a garbd server in there somewhere?

  • #2
    You need a 9th node to avoid split brain (two 4-node clusters). You can run it on amazon ec2 for example.


    • #3
      Not an explanation but a statement, whihc doesnt help me at all in understanding.
      So what you are aying is that you can never have an even number opf database in a cluster, you always have to have an odd number.
      Seems silly to me. Surely in the scenario I set out above (which is an 8 node cluster, not 2x4 nodes) you will still have 4 nodes, and therefore still have a cluster. What if you have a 5 node cluster and permanently lose one machine? Can someone please explain the why to me?


      • #4
        You can have a cluster with 4 nodes, but you need more than a half nodes up (in this case 3) to have your cluster working.

        For example, in a 4 nodes cluster, if you lost the connection between datacenters and you have 2 nodes up on one side and 2 nodes up in another side, there is no way to determine which one is the correct one to use, that's why you need more than a half. (http://www.codership.com/wiki/doku.php?id=info&s[]=quorum#galera_wsrep_provider)

        So in summary, yes, you can make clusters of 4 nodes (you will need 3 nodes up), 6 nodes (you will need 4 nodes up), etc...

        Martin Arrieta