Nextcloud and MariaDB / MySQL Galera (mid-2018 edition)


#1

What’s the latest on using Nextcloud with Galera? Having a multi-master DB cluster is the best way to have a highly available and load-balanced cluster within a DC yet last I checked, this wasn’t supported.

This forum news posts mentions Galera support without any technical information on how to set it up.

I ask now since Nextcloud 14 is on the way. I’m hoping something has changed.

For those not familiar with the issue, a multi-master Galera cluster requires the transaction isolation level to be REPEATABLE-READ. According to the Nextcloud docs, the isolation level READ COMMITED needs to be set for the database. As these are conflicting, multi-master Galera cannot be used with Nextcloud.


#2

Hi there,

I am using a MariaDB 10.3 Galera Master-Master replication and HAProxy for load balancing/fail over.
I had a look at this and included check fall 1 rise 2 to my HAProxy config file.

So far I have not seen any issues with my Galera cluster.

To be honest: I also had a look at SQLProxy but I am running my load balancer on a Raspberry Pi and as usual: It is not supported.
I compiled it anyway and had a look at it. Too much to configure so I sticked with HAProxy.


#3

Okay I got some error messages in my log: Mostly connection lost.
I installed MaxScale for write/read splitting.
With this I have not had any issues so far.

In addition to that I have tried to install MaxScale on a Raspberry Pi - Unfortunately there are no packages available and compiling it wasn’t successful.

I have tried HAProxy first of all + read/write splitting with mysqlnd_ms but this did not work with my server as I run multiple instances of nextcloud.


#4

Thank you so much for coming back with updates.

To make sure I’m following along, you have:

  • a MariaDB Galera master/master cluster (how many nodes, 3?)
  • MaxScale in front of the cluster. Writing to 1 node and reading from the rest?

#5

Hi !

We have deployed a galera cluster (3 nodes) with maxscale proxy (Read-write split.

So fare everything is working smoothly.

If you need information, feel free to send me a PM.

Regards


#6

It would be awesome if you could share a bit on how to setup this with Nextcloud.


#7

Hi !

Sorry i didnt managed to answer earlier.

We used six Ubuntu servers, three for the galera cluster and three application servers.

Our galera setup is simple, i used Ubuntu HACI instructions, you can find it with a Google search.

We installed Maxscale on our three application servers, with a read write configuration.

We assigned a virtual IP adress for our database queries, we use keepalive on each application servers to manage this.

I can share some or the configuration files, or some of the ressources i found on internet that helped me setup the infrastructure if you are interested.

Regards


#8

Yes I have a master/master cluster. I’ve started with three clusters + added another one last week.

And also yes: MaxScale is doing the read/write logic. It’s very a fire and forget situation. For monitoring I am using ClusterControl (from SeveralNines).