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

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.

1 Like

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.

1 Like

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.

1 Like

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?

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.


1 Like

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

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.


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).

I know this is a bit old - I am working on a larger setup and had a few questions on this setup as I have run into a few problems with the setup of the mariadb and best way to setup with nextcloud 19. Anyone around able to help out?

What do you need?

Currently working on setting up the mariadb master master cluster – would a single instance of maxscale work or would multiple maxscale on each app server need to be used.

Also as per nextcloud they recommend master slave instead of master master – this is going to be a large enterprise build so want to make sure its stable and not prone to errors.

Any tips/tricks or guidelines that I should follow?

I had a single Maxscale instance running but for failover it might be a better solution to have two Maxscale instances and keepalived in place for failover.

When I implemented the Galera cluster I used following website as a guidline:

But I have to say that I migrated to PostgreSQL 1.5 years ago due to some changes in my database architecture.

Hi all.

I have a master-slave setup and Maxscale in front of it, in RW Split mode, but 'im facing a problem: i can’t delete folders/files. I can upload, move, copy, etc, but each time i try to delete, i get an error.

  • If i disable Maxscale and route all traffic to a single server, no problems.
  • With Maxscale enabled BUT one server off (so Maxscale only sees one server and all traffic goes there), no problem
  • With Maxscale and the two servers enabled, one master for Writes and one Slave for Reads, i can’t delete files or folders. Everything else works (apps, users, uploads, etc…)

Any idea from you guys?

I had issues with maxscale working properly myself and have moved over to proxysql utilizing several nines clustercontrol. Makes administration much easier along with the cluster database setup. I would test your issue im my curent build although I am currently having issues with redis and haproxy.

1 Like