Maxscale with galera and nextcloud 14

Here is the maxscale config I use. You have to create the maxscale and maxscale-monitor accounts manually and give them rights on your databases.

# MaxScale documentation:
# https://mariadb.com/kb/en/mariadb-maxscale-25/

# Global parameters
#
# Complete list of configuration options:
# https://mariadb.com/kb/en/mariadb-maxscale-25-mariadb-maxscale-configuration-guide/

[maxscale]
threads=auto
admin_host=0.0.0.0
admin_secure_gui=false

# Server definitions
#
# Set the address of the server to the network
# address of a MariaDB server.
#

[MARIADB-1]
type=server
address=XXXXXXX
port=3306
protocol=MariaDBBackend

[MARIADB-5]
type=server
address=XXXXXXX
port=3306
protocol=MariaDBBackend

[MARIADB-2]
type=server
address=XXXXXXX
port=3306
protocol=MariaDBBackend

[MARIADB-3]
type=server
address=XXXXXXX
port=3306
protocol=MariaDBBackend

[MARIADB-4]
type=server
address=XXXXXXX
port=3306
protocol=MariaDBBackend


# Monitor for the servers
#
# This will keep MaxScale aware of the state of the servers.
# MariaDB Monitor documentation:
# https://mariadb.com/kb/en/maxscale-25-monitors/

[Galera-Monitor]
type=monitor
module=galeramon
servers=MARIADB-1, MARIADB-2, MARIADB-3, MARIADB-4, MARIADB-5
user=maxscale_monitor
password=XXXXXXX
monitor_interval=2000ms

#ip Service definitions
#
# Service Definition for a read-only service and
# a read/write splitting service.
#

# ReadConnRoute documentation:
# https://mariadb.com/kb/en/mariadb-maxscale-25-readconnroute/

#[Read-Only-Service]
#type=service
#router=readconnroute
#servers=server1
#user=myuser
#password=mypwd
#router_options=slave

# ReadWriteSplit documentation:
# https://mariadb.com/kb/en/mariadb-maxscale-25-readwritesplit/

[Read-Write-Service]
type=service
router=readwritesplit
servers=MARIADB-1, MARIADB-2, MARIADB-3, MARIADB-4, MARIADB-5
user=maxscale
password=XXXXXXX
master_reconnection=true
master_failure_mode=fail_on_write
retry_failed_reads=true

# Listener definitions for the services
#
# These listeners represent the ports the
# services will listen on.
#

#[Read-Only-Listener]
#type=listener
#service=Read-Only-Service
#protocol=MariaDBClient
#port=4008

[Read-Write-Listener]
type=listener
service=Read-Write-Service
protocol=MariaDBClient
port=3306

1 Like