GreatSQL8.0.32-26使用GreatSQL Shell从单主切换成多主失败
操作系统:龙蜥8.9GreatSQL:8.0.32-26
GreatSQL Shell:8.0.32-25
错误日志输出:无
具体操作如下:
MySQL192.168.116.41:3306 sslJS > c.status();
{
"clusterName": "MGR1",
"defaultReplicaSet": {
"name": "default",
"primary": "192.168.116.41:3306",
"ssl": "REQUIRED",
"status": "OK",
"statusText": "Cluster is ONLINE and can tolerate up to ONE failure.",
"topology": {
"192.168.116.41:3306": {
"address": "192.168.116.41:3306",
"memberRole": "PRIMARY",
"mode": "R/W",
"readReplicas": {},
"replicationLag": "applier_queue_applied",
"role": "HA",
"status": "ONLINE",
"version": "8.0.32"
},
"192.168.116.42:3306": {
"address": "192.168.116.42:3306",
"memberRole": "SECONDARY",
"mode": "R/O",
"readReplicas": {},
"replicationLag": "applier_queue_applied",
"role": "HA",
"status": "ONLINE",
"version": "8.0.32"
},
"192.168.116.43:3306": {
"address": "192.168.116.43:3306",
"memberRole": "SECONDARY",
"mode": "R/O",
"readReplicas": {},
"replicationLag": "applier_queue_applied",
"role": "HA",
"status": "ONLINE",
"version": "8.0.32"
}
},
"topologyMode": "Single-Primary"
},
"groupInformationSourceMember": "192.168.116.41:3306"
}
MySQL192.168.116.41:3306 sslJS >c.switchToMultiPrimaryMode()
Switching cluster 'MGR1' to Multi-Primary mode...
Instance '192.168.116.41:3306' remains PRIMARY.
Instance '192.168.116.42:3306' remains SECONDARY.
Instance '192.168.116.43:3306' remains SECONDARY.
The cluster successfully switched to Multi-Primary mode.
MySQL192.168.116.41:3306 sslJS > c.status();
Cluster.status: The InnoDB Cluster topology type (Multi-Primary) does not match the current Group Replication configuration (Single-Primary). Please use <cluster>.rescan() or change the Group Replication configuration accordingly. (RuntimeError)
MySQL192.168.116.41:3306 sslJS >
切主后,会断开当前连接。
所以试试重新连接,应该就可以了。 yejr 发表于 2024-10-8 14:37
切主后,会断开当前连接。
所以试试重新连接,应该就可以了。
MySQL192.168.116.41:3306 sslJS >c.switchToMultiPrimaryMode()
Switching cluster 'MGR1' to Multi-Primary mode...
Instance '192.168.116.41:3306' remains PRIMARY.
Instance '192.168.116.42:3306' remains SECONDARY.
Instance '192.168.116.43:3306' remains SECONDARY.
看这个切换成多主是失败,其他两个节点没切换成PRIMARY.重新登录还是单主。 tony 发表于 2024-10-8 14:44
MySQL192.168.116.41:3306 sslJS >c.switchToMultiPrimaryMode()
Switching cluster 'MGR1' to Mul ...
请补充提供my.cnf中关于MGR部分的配置,以及切主期间相应的日志内容。
怀疑是开启了fast-mode导致无法切多主。 yejr 发表于 2024-10-8 14:52
请补充提供my.cnf中关于MGR部分的配置,以及切主期间相应的日志内容。
怀疑是开启了fast-mode导致无法切 ...
是的,老师,是开启了快速单主模式导致的。 tony 发表于 2024-10-8 14:59
是的,老师,是开启了快速单主模式导致的。
快速单主模式下,无法切成多主模式。
详情参见手册中最后的提醒内容 https://greatsql.cn/docs/8.0.32- ... -mgr-fast-mode.html。 yejr 发表于 2024-10-8 16:46
快速单主模式下,无法切成多主模式。
详情参见手册中最后的提醒内容 https://greatsql.cn/docs/8.0.32- . ...
好的,谢谢。
页:
[1]