I am testing a MariaDB Galera Cluster set up with only 2 nodes, I have three servers haproxy, node1
and node2
. I was able to set it up and it worked fine until testing phase.
There are two types of test that I made:
- The main node fails
- The second node fails
While testing I came across this page which describes the problems.
So I was thinking of setting up garbd on both servers as what the guide said, but I don't think it is working(?)
Here is my garbd config:
group="galera-testing"
address="gcomm://10.10.10.16,10.10.10.17"
options="gmcast.listen_addr=tcp://0.0.0.0:4444"
log="/var/log/garbd.log"
If I run sudo garbd --cfg /etc/garbd.cnf
the logs stop at: Note: I started this on both servers
INFO: (b363d915-923d, 'tcp://0.0.0.0:4444') turning message relay requesting off
And I can't continue using the terminal without killing it.
Now, I'm thinking of two options:
-
Setting garbd on my HAProxy Server making it act as the arbitrator or
-
Setting garbd on both nodes (im confused as the guide says to set it on both servers? what??)
Can anyone point me to the right direction? Thanks!
Note: I was able to test Galera Clusters with three nodes before + HAProxy, and it went better than with two nodes. But to satisfy my curiousity, I kinda want to learn this one works too.
Best Answer
Two node galera is a fundamentally broken design as it cannot maintain uptime without a quorum and the ability of a node to go down to aid recovery.
garb is a toy test thing and not a production tool.
Use 3 nodes all as full galera member nodes.
Use haproxy in a redundant configuration on all nodes. Use a different IP addresses for haproxy and galera without overlap.
If it can't be reliable in test then it won't be reliable in production.