文件首頁
MySQL Shell for VS Code


MySQL Shell for VS Code  /  ...  /  InnoDB ClusterSet 方法

Pre-General Availability: 2024-07-17

5.6.3 InnoDB ClusterSet 方法

ClusterSet 物件是用於管理和監控 MySQL InnoDB ClusterSet 的進入點。

ClusterSets 允許 InnoDB Cluster 部署透過在其他位置或資料中心建立複本叢集,為整個資料中心或地理位置實現容錯,確保可進行災害復原。

下表列出可用的 InnoDB ClusterSet Python 方法。

InnoDB ClusterSet 方法 描述
create_replica_cluster() 建立新的 InnoDB 叢集,作為主要叢集的複本。
describe() 描述 InnoDB ClusterSet 的結構。
disconnect() 中斷 InnoDB ClusterSet 物件使用的所有內部工作階段連線。
force_primary_cluster() 執行 ClusterSet 主要 InnoDB 叢集的容錯移轉。
get_name() 傳回 InnoDB ClusterSet 的網域名稱。
help([member]) 提供關於此類別及其指定成員的說明。
list_routers() 列出 InnoDB ClusterSet 的 MySQL Router 執行個體,或單一 MySQL Router 執行個體。
options() 列出 InnoDB ClusterSet 設定選項。
rejoin_cluster() 將失效的 InnoDB 叢集重新加入 InnoDB ClusterSet 並更新複寫。
remove_cluster() 從 InnoDB ClusterSet 移除複本 InnoDB 叢集。
routing_options() 列出 InnoDB ClusterSet Router 設定選項。
set_option() 變更整個 InnoDB ClusterSet 的選項值。
set_primary_cluster() 執行 ClusterSet 主要 InnoDB 叢集的安全切換。
set_routing_option() 變更全域 MySQL 路由選項或單一 MySQL Router 執行個體的值。
status() 描述 InnoDB ClusterSet 的狀態。

您可以使用 ClusterSet.help 命令找到關於特定方法的更多說明。例如,若要查看指派給 cs 變數的 InnoDB ClusterSet 的 create_replica_cluster 方法的說明詳細資料,請輸入

Python

cs.help("create_replica_cluster")

JavaScript

cs.help("createReplicaCluster")