简体   繁体   English

具有多集群设置的MaxScale

[英]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. 我一直在为某些数据库服务器开发某些高可用性方案,并检查了MaxScale和HAProxy,两者看起来都很有趣,但是问题如下。 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. 设置MaxScale时,一切都进行得很好,直到我发现看不到在同一MaxScale实例上创建多个集群的方法,但这是必须使用一个MaxScale实例控制的数据库服务器数量的必要条件。

Is there any way to implement multiple clusters when setting up MaxScale or is this just something that isn't implemented in MaxScale? 设置MaxScale时,有什么方法可以实现多个集群,或者这只是MaxScale中没有实现的事情?

Thank you for your help 谢谢您的帮助

To use multiple clusters with one MaxScale, just define multiple servers, monitors, services and listeners. 要在一个MaxScale上使用多个集群,只需定义多个服务器,监视器,服务和侦听器。 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 . 这将在端口4006上公开读写拆分服务,该服务将对服务器server1server2进行读写拆分。

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. 例如,一个群集可以在端口4006上侦听,另一个群集可以在4007上侦听。然后可以使用这两个群集将两个不同的应用程序连接到两个不同的群集。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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