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.

6
  • 1
    with Galera cluster, all members can write and will replicate writesets synchronously.
    – rkosegi
    Commented Jul 28, 2022 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
    Commented Jul 28, 2022 at 21:58
  • so is there a way to fix that with the above options?
    – Eric Fritz
    Commented Jul 29, 2022 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
    Commented Jul 30, 2022 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
    Commented Aug 1, 2022 at 14:59

1 Answer 1

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.

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.