GreatSQL社区

搜索

[已解决] GreatSQL8.0.32-26使用GreatSQL Shell从单主切换成多主失败

127 6 2024-10-8 14:31
操作系统:龙蜥8.9

GreatSQL:8.0.32-26
GreatSQL Shell:8.0.32-25
错误日志输出:无
具体操作如下:
  1. MySQL  192.168.116.41:3306 ssl  JS > c.status();
  2. {
  3.     "clusterName": "MGR1",
  4.     "defaultReplicaSet": {
  5.         "name": "default",
  6.         "primary": "192.168.116.41:3306",
  7.         "ssl": "REQUIRED",
  8.         "status": "OK",
  9.         "statusText": "Cluster is ONLINE and can tolerate up to ONE failure.",
  10.         "topology": {
  11.             "192.168.116.41:3306": {
  12.                 "address": "192.168.116.41:3306",
  13.                 "memberRole": "PRIMARY",
  14.                 "mode": "R/W",
  15.                 "readReplicas": {},
  16.                 "replicationLag": "applier_queue_applied",
  17.                 "role": "HA",
  18.                 "status": "ONLINE",
  19.                 "version": "8.0.32"
  20.             },
  21.             "192.168.116.42:3306": {
  22.                 "address": "192.168.116.42:3306",
  23.                 "memberRole": "SECONDARY",
  24.                 "mode": "R/O",
  25.                 "readReplicas": {},
  26.                 "replicationLag": "applier_queue_applied",
  27.                 "role": "HA",
  28.                 "status": "ONLINE",
  29.                 "version": "8.0.32"
  30.             },
  31.             "192.168.116.43:3306": {
  32.                 "address": "192.168.116.43:3306",
  33.                 "memberRole": "SECONDARY",
  34.                 "mode": "R/O",
  35.                 "readReplicas": {},
  36.                 "replicationLag": "applier_queue_applied",
  37.                 "role": "HA",
  38.                 "status": "ONLINE",
  39.                 "version": "8.0.32"
  40.             }
  41.         },
  42.         "topologyMode": "Single-Primary"
  43.     },
  44.     "groupInformationSourceMember": "192.168.116.41:3306"
  45. }
  46. MySQL  192.168.116.41:3306 ssl  JS >  c.switchToMultiPrimaryMode()
  47. Switching cluster 'MGR1' to Multi-Primary mode...

  48. Instance '192.168.116.41:3306' remains PRIMARY.
  49. Instance '192.168.116.42:3306' remains SECONDARY.
  50. Instance '192.168.116.43:3306' remains SECONDARY.

  51. The cluster successfully switched to Multi-Primary mode.
  52. MySQL  192.168.116.41:3306 ssl  JS > c.status();
  53. 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)
  54. MySQL  192.168.116.41:3306 ssl  JS >
复制代码



全部回复(6)
yejr 2024-10-8 14:37:03
切主后,会断开当前连接。
所以试试重新连接,应该就可以了。
tony 2024-10-8 14:44:31
yejr 发表于 2024-10-8 14:37
切主后,会断开当前连接。
所以试试重新连接,应该就可以了。

MySQL  192.168.116.41:3306 ssl  JS >  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.  重新登录还是单主。
yejr 2024-10-8 14:52:54
tony 发表于 2024-10-8 14:44
MySQL  192.168.116.41:3306 ssl  JS >  c.switchToMultiPrimaryMode()
Switching cluster 'MGR1' to Mul ...

请补充提供my.cnf中关于MGR部分的配置,以及切主期间相应的日志内容。

怀疑是开启了fast-mode导致无法切多主。
tony 2024-10-8 14:59:53
yejr 发表于 2024-10-8 14:52
请补充提供my.cnf中关于MGR部分的配置,以及切主期间相应的日志内容。

怀疑是开启了fast-mode导致无法切 ...

是的,老师,是开启了快速单主模式导致的。
yejr 2024-10-8 16:46:19
tony 发表于 2024-10-8 14:59
是的,老师,是开启了快速单主模式导致的。

快速单主模式下,无法切成多主模式。

详情参见手册中最后的提醒内容 https://greatsql.cn/docs/8.0.32- ... -mgr-fast-mode.html
tony 2024-10-9 08:37:46
yejr 发表于 2024-10-8 16:46
快速单主模式下,无法切成多主模式。

详情参见手册中最后的提醒内容 https://greatsql.cn/docs/8.0.32- . ...

好的,谢谢。
tony

8

主题

0

博客

132

贡献

注册会员

Rank: 2

积分
154

助人为乐(铜)

合作电话:010-64087828

社区邮箱:greatsql@greatdb.com

社区公众号
社区小助手
QQ群
GMT+8, 2024-10-18 17:21 , Processed in 0.020639 second(s), 18 queries , Redis On.
快速回复 返回顶部 返回列表