Pick node with index of 0 as the Galera master

When a Galera cluster loses a member, it will recalculate the
wsrep_local_index values. As the index is zero-based, we can be certain
that in a valid cluster there will always be a node with an index of 0.

If the galeramon can't find a node with an index of 0, it means that
either the cluster hasn't stabilized and there's a pending recalculation
of the index or that there's no connectivity between MaxScale and the node
with the index value 0.

With this change and default settings, active-active MaxScale setups with
Galera clusters should always choose the same node as the master.
This commit is contained in:
Markus Mäkelä
2016-12-16 19:33:05 +02:00
parent 067d48ddc6
commit 2b5ec8f162
4 changed files with 55 additions and 16 deletions

View File

@ -62,6 +62,20 @@ Enable interaction with server priorities. This will allow the monitor to determ
use_priority=true
```
### `root_node_as_master`
This option controls whether the write master Galera node requires a
_wsrep_local_index_ value of 0. This option is enabled by default and was
introduced in MaxScale 2.1.0.
A Galera cluster will always have a node which has a _wsrep_local_index_ value
of 0. Based on this information, multiple MaxScale instances can always pick the
same node for writes.
If the `root_node_as_master` option is disabled for galeramon, the node with the
lowest index will always be chosen as the master. If it is enabled, only the
node with a a _wsrep_local_index_ value of 0 can be chosed as the master.
## Interaction with Server Priorities
If the `use_priority` option is set and a server is configured with the