暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

mysql ocp题库解析-003

原创 会UI设计的dba 2025-05-29
83

Choose the best answer.
An attempt to recover an InnoDB Cluster fails.
Examine this set of messages and responses:
host3: 3377 ssl JS > dba.rebootClusterFromCompleteOutage ()
Reconfiguring the default cluster from complete outage. . .
The instance ’ host1:3377’ was part of the cluster configuration.
Would you like to rejoin it to the cluster? [y/N] : y
The instance ’ host2:3377’ was part of the cluster configuration.
Would you like to rejoin it to the cluster? [y/N] : y
Dba.rebootClusterFromCompleteOutage: The active session instance isn’t the most updated in
comparison with the ONLINE instances of the Cluster’s metadata.
Please use the most up to date instance: ’ host1:3377’. (RuntimeError)
Which statement is true?
A) The cluster is running and there is at least one ONLINE instance.
B) The instance deployed on host3 must be synchronized from a donor deployed on host1 by
using the command cluster.addInstance(‘host1:3377’).
C) It is possible to determine the most up-to-date instance by comparing different global
transaction identifier (GTID) sets with GTID_SUBSET (set1, set2).
D) The active session instanceis invalid and must be re-created by using the command
shell.connect (‘host3:3377’).
E) The instance deployed on host3 must be rebuilt with a backup from the primary instance.

答案:C) It is possible to determine the most up-to-date instance by comparing different global transaction identifier (GTID) sets with GTID_SUBSET (set1, set2).


解析:

  1. 错误核心分析
    错误信息明确提示:

    “The active session instance isn’t the most updated… Please use the most up to date instance: ‘host1:3377’”
    表明当前连接的实例(host3:3377不是数据最新的节点,而 host1:3377 拥有更完整的 GTID 集合。

  2. 选项 C 的正确性

    • 通过 MySQL 的 GTID_SUBSET() 函数 可比较不同实例的 GTID 集合,精确识别最新节点:
      -- 在 host1 上执行 SELECT GTID_SUBSET(@@global.gtid_executed, (SELECT @@global.gtid_executed FROM host3)) AS host1_newer; -- 返回 1 表示 host1 的 GTID 集合包含 host3 的所有事务
    • 原理:GTID 集合的包含关系(如 set1 ⊆ set2)直接反映数据的新旧程度。
    • 操作:用户需连接到不同实例,分别查询 @@global.gtid_executed 并进行比较。
  3. 其他选项排除

    • A) 错误:集群处于完全宕机状态(complete outage),无 ONLINE 节点。
    • B) 错误:cluster.addInstance 用于添加新节点,而非同步已有节点;且最新节点是 host1 而非 host3
    • D) 错误:连接命令 shell.connect() 不会解决数据不一致问题。
    • E) 错误:无需重建 host3,只需用最新节点(host1)执行恢复。

结论

GTID 集合比较(选项 C) 是确定最新节点的标准方法,符合错误提示的解决路径。执行恢复时需切换到 host1:3377 运行 dba.rebootClusterFromCompleteOutage()

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论