0

I am currently running a Galera Cluster in Kubernetes. The problem I am having is whenever I use a replicaset for Galera it causes problems. The problems stems from the service I have calling the first node I deploy as the "Write" member. The other two members are then designated as "Readers". If the "Write" member goes down, it causes my other two pods to crash even though they are all deemed as Masters within the MySQL database.

I was looking into workarounds for this but I was wondering if any of you had any experience with this. I saw about using a Write LoadBalancer Proxy like ProxySQL or MaxScale but I don't know if these specifically tackle the problem I am having. I also do not know enough about Kubernetes if I could choose multiple "write" members in Kubernetes with just more service yaml files.

  • 1
    with Galera cluster, all members can write and will replicate writesets synchronously. – rkosegi Jul 28 '22 at 19:23
  • It not 100% synchronous as writesets aren't applied synchronously, only they are ensured not to conflict. As such you can write, and read from another node and it may not be applied yet. – danblack Jul 28 '22 at 21:58
  • so is there a way to fix that with the above options? – Eric Fritz Jul 29 '22 at 15:31
  • You can set up Galera as if there is one Primary and multiple Replicas, or as all Primaries. Your question is confusing since it seems to talk about one approach, then the other. Which way is it set up? – Rick James Jul 30 '22 at 16:30
  • I believe we have our Galera set up for all the nodes to be considered Primary (out of 3). Although when we choose to write to them, we only choose for 1 to be written to and the others then copy over. The problem is that if my first node goes down, then the other two cannot recover so we were looking into options for fixing this. Do we not need a write proxy and are we overthinking it? – Eric Fritz Aug 01 '22 at 14:59
  • "The problem is that if my first node goes down, then the other two cannot recover so we were looking into options for fixing this." This is the weird part: loosing just one node in a three node cluster should not cause the other to to stop as they still have majority. Can you provide error log output form all three nodes? – Hartmut Holzgraefe Aug 13 '22 at 14:07

1 Answers1

0

Consider to setup ProxySQL. Add the instances in the same group at mysql_servers. Next, declare the max_writers = 3 in mysql_galera_hostgroups.