0

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:

  1. The main node fails
  2. 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.

2 Answers 2

0

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.

3
  • I see, I was just given three servers to test it, so can I use my HAProxy Server then as a third node then?
    – Gwynn
    Commented Jul 6, 2020 at 3:26
  • I can't see why not. I haven't see the specs however HAproxy or any tcp based proxy should be quite light weight. Don't forget to make that HA too with multiple instances. Possibly of interest is proxy support in mariadb for getting the client IP address. Its optional.
    – danblack
    Commented Jul 6, 2020 at 7:16
  • It's just twice the recommended specs for a standard CentOS system, just for testing purposes, resources will probably be reused when we apply the set up for production. I have already set up the back up node on my HAProxy Server, and it's much easier to start/stop the service. Thank you!
    – Gwynn
    Commented Jul 6, 2020 at 9:18
0

My configuration works just fine, forgot to add port 4567 on each node IPs and removed the options.

group="galera-testing" 
address="gcomm://10.10.10.15:4567, 10.10.10.16:4567, 10.10.10.17:4567" 
log="/var/log/garbd.log"

Now my 2-node galera works. Even if one goes down, I can still transmit data to the database.

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.