简体   繁体   中英

MaxScale with multicluster setup

I've been working on some High Availability scenario's for some database servers and inspected MaxScale & HAProxy and both seem very interesting but the problem is as follows. When setting up MaxScale everything went well until I discovered that I don't see a way to create multiple clusters on the same MaxScale instance but this is a necessity for the amount of database servers that will have to be controlled using one MaxScale instance.

Is there any way to implement multiple clusters when setting up MaxScale or is this just something that isn't implemented in MaxScale?

Thank you for your help

To use multiple clusters with one MaxScale, just define multiple servers, monitors, services and listeners. Here is an example of one cluster being used as a service:

[server1]
type=server
address=127.0.0.1
port=3000
protocol=MariaDBBackend

[server2]
type=server
address=127.0.0.1
port=3001
protocol=MariaDBBackend

[Cluster-1-Monitor]
type=monitor
module=mariadbmon
servers=server1,server2
user=maxuser
passwd=maxpwd
monitor_interval=5000

[Cluster-1-Router]
type=service
router=readwritesplit
servers=server1,server2
user=maxuser
passwd=maxpwd

[Cluster-1-Listener]
type=listener
service=Cluster-1-Router
protocol=MariaDBClient
port=4006

This would expose the read-write splitting service on port 4006 that would do read-write splitting over the servers server1 and server2 .

To define another one, just add:

  • The servers that define the cluster
  • A monitor for monitoring the servers
  • A service that uses the servers
  • A listener that connects to the service

This way you can expose multiple ports that connect to different clusters. For example, one cluster could listen on port 4006 and another on 4007. These two could then be used to connect two different applications to two different clusters.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM