简体   繁体   English

MaxScale 集群(主-主)设置

[英]MaxScale cluster (master-master) setup

When deploying multiple MaxScale in a Master-Slave typology (failover from master to slave with Keepalived or similar) in front of a Galera Cluster in read-write-split mode , everything goes fine.当以read-write-split模式在 Galera 集群前以主从类型(从主到从故障转移到从服务器上使用 Keepalived 或类似方式)部署多个 MaxScale 时,一切正常。 But what about a Master-Master like typology in a round-robin fashion, is this possible?但是对于像循环方式的类型学的大师大师,这可能吗?

Ex.: Having one MaxScale at 10.0.0.1, a 2nd at 10.0.0.2 and Haproxy in front of it with a roundrobin or leastconn distribution algorithm (or even without Haproxy/load-balancer, where applications just connect randomly to one or another) is this possible/well supported by MaxScale?例:有一个在MaxScale 10.0.0.1,在一个10.0.0.2第2和HAProxy的与它前面roundrobinleastconn分配算法(或即使没有HAProxy的/负载均衡器,其中的应用程序只是随机连接到一个或另一个) MaxScale是否可能/很好地支持?

Usually you can connect to any number of MaxScale instances as long as certain features are enabled to guarantee that all MaxScale instances pick the same server where they send writes to.通常您可以连接到任意数量的 MaxScale 实例,只要启用了某些功能以保证所有 MaxScale 实例选择它们发送写入的同一服务器。

Galera Clusters Galera集群

If you are using a Galera cluster, this can be done in a safe and conflict-free manner by enabling the root_node_as_master parameter.如果您使用的是 Galera 集群,则可以通过启用root_node_as_master参数以安全且无冲突的方式完成此操作。 It uses the Galera cluster itself to select which node it uses for writes.它使用 Galera 集群本身来选择它用于写入的节点。 This allows your applications to connect to either of the MaxScale instances.这允许您的应用程序连接到任一 MaxScale 实例。

Even without this parameter it would not cause any problems with the database itself but due to the way Galera works, you increase the likelihood of running into a conflict when you COMMIT your transaction if you write to multiple nodes.即使没有这个参数,它也不会对数据库本身造成任何问题,但由于 Galera 的工作方式,如果你写入多个节点,你会增加在提交事务时遇到冲突的可能性。

Asynchronous Replication Clusters异步复制集群

If you use MaxScale with a cluster that uses asynchronous replication, you still can do this as long as you configure your mariadbmon monitor to use cooperative_monitoring_locks .如果您将 MaxScale 与使用异步复制的集群一起使用,只要您将mariadbmon监视器配置为使用cooperative_monitoring_locks mariadbmon监视mariadbmon ,您仍然可以执行此操作。 This causes the MaxScale instances to communicate via the database about which servers they see and which of them they chose for writes.这会导致 MaxScale 实例通过数据库就它们看到哪些服务器以及它们选择哪些服务器进行写入进行通信。

An added benefit of cooperative_monitoring_locks is that you can enable the automated cluster management parameters auto_failover and auto_rejoin without having to worry about two MaxScales attempting to change the replication configuration at the same time: cooperative_monitoring_locks makes sure only one MaxScale does it.还有一个好处cooperative_monitoring_locks是,你可以启用自动化集群管理参数auto_failoverauto_rejoin不必约两MaxScales试图在同一时间更改复制配置的担心: cooperative_monitoring_locks确保只有一个MaxScale做的。

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

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