文件首頁
MySQL Shell 8.4
下載本手冊
PDF (美式信紙) - 2.2Mb
PDF (A4) - 2.3Mb


MySQL Shell 8.4  /  MySQL InnoDB Cluster

第 7 章 MySQL InnoDB Cluster

MySQL InnoDB Cluster 為 MySQL 提供完整的高可用性解決方案。透過使用 AdminAPI(隨附於 MySQL Shell),您可以輕鬆設定和管理至少三個 MySQL 伺服器執行個體的群組,使其作為 InnoDB Cluster 運作。

InnoDB Cluster 中的每個 MySQL 伺服器執行個體都會執行 MySQL 群組複寫,這提供了在 InnoDB Cluster 中複寫資料的機制,並內建容錯移轉。AdminAPI 讓您無需直接在 InnoDB Cluster 中使用群組複寫,但如需更多資訊,請參閱 群組複寫,其中說明了詳細資訊。您也可以設定 InnoDB ClusterSet(請參閱第 8 章,MySQL InnoDB ClusterSet),透過將主要 InnoDB Cluster 與一個或多個位於替代位置(例如不同的資料中心)的複本連結,為 InnoDB Cluster 部署提供容災能力。

MySQL Router 可以根據您部署的叢集自動設定,將用戶端應用程式透明地連線至伺服器執行個體。如果伺服器執行個體發生意外故障,叢集會自動重新設定。在預設的單一主要模式中,InnoDB Cluster 具有單一讀寫伺服器執行個體 - 主要伺服器。多個次要伺服器執行個體是主要伺服器的複本。如果主要伺服器發生故障,則會自動將次要伺服器升級為主要伺服器的角色。MySQL Router 會偵測到這一點,並將用戶端應用程式轉送到新的主要伺服器。進階使用者也可以設定叢集以擁有多個主要伺服器。

下圖顯示了這些技術如何協同運作的概述

圖 7.1 InnoDB Cluster 概觀

Three MySQL servers are grouped together as a high availability cluster. One of the servers is the read/write primary instance, and the other two are read-only secondary instances. Group Replication is used to replicate data from the primary instance to the secondary instances. MySQL Router connects client applications (in this example, a MySQL Connector) to the primary instance.

重要事項

InnoDB Cluster 不支援 MySQL NDB Cluster。NDB Cluster 依賴 NDB 儲存引擎,以及許多特定於 NDB Cluster 的程式,這些程式未隨附於 MySQL Server 8.4;NDB 僅作為 MySQL NDB Cluster 發行版本的一部分提供。此外,MySQL Server 8.4 隨附的 MySQL 伺服器二進位檔案 (mysqld) 不能與 NDB Cluster 搭配使用。如需更多關於 MySQL NDB Cluster 的資訊,請參閱 MySQL NDB Cluster 8.4使用 InnoDB 的 MySQL 伺服器與 NDB Cluster 的比較提供了有關 InnoDBNDB 儲存引擎之間差異的資訊。