0

我正在使用带有 3 个 galera 服务器(mariadb 10.4)的 maxscale(6.2)readwritesplit 路由器。其中 2 个在 DC1,第 3 个在遥远的 DC2。

使用等级是我在这里看到的唯一选项,prioritygaleramon 将使用它来选择主人。

我的目标是告诉 maxscale 尽可能多地使用 DC1,因此 server1 作为主服务器(优先级 = 1,排名 = 主),服务器 2 作为从设备(优先级 = 2,排名 = 主),并且只有在服务器 1或服务器2时才使用 DC2 服务器 3无法访问(优先级=3,排名=次要)。

这是正确的行为吗?

[server1]
type=server
address=192.168.0.11
priority=1
rank=primary

[server2]
type=server
address=192.168.0.12
priority=2
rank=primary

[server3]
type=server
address=192.168.0.21
priority=3
rank=secondary

[split]
type=service
router=readwritesplit
servers=server1,server2,server3

[monitor]
type=monitor
module=galeramon
servers=server1,server2,server3
root_node_as_master=true
use_priority=true
4

1 回答 1

1

Yes, the readwritesplit module only uses connections that have the same rank. This means that if both server1 and server2 fail, the readwritesplit service will use server3 as long as it is up.

When either of the two other servers comes back up, the galeramon monitor will shift the Master label from server3 to one of the other nodes. At that point readwritesplit will discard the connection to server3 and reconnect to the nodes with the higher rank, if possible.

于 2022-02-22T12:57:47.023 回答