管理 Amazon Aurora 全域資料庫 - Amazon Aurora

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

管理 Amazon Aurora 全域資料庫

您會在構成 Aurora 全域資料庫的個別叢集上執行大部分的管理操作。當您在主控台的 Databases (資料庫) 頁面上選擇 Group related resources (組合相關資源) 時,您會看到主要叢集和次要叢集在相關聯的全球資料庫下分組。若要尋找正在執行全域資料庫之資料庫叢集的 AWS 區域、其 Aurora 資料庫引擎和版本,以及其識別符,請使用其 Configuration (組態) 標籤。

跨區域資料庫容錯移轉程序僅適用於 Aurora 全球資料庫,不適用於單一 Aurora 資料庫叢集。如需進一步了解,請參閱在 Amazon Aurora 全球資料庫中使用轉換或容錯移轉

若要從其主要區域的計劃外中斷復原 Aurora 全域資料庫,請參閱從計劃外中斷復原 Amazon Aurora 全域資料庫

修改 Amazon Aurora 全域資料庫

AWS Management Console 的 Databases (資料庫) 頁面會列出所有 Aurora 全球資料庫,並顯示各自的主要叢集和次要叢集。Aurora 全域資料庫擁有其自身的組態設定。具體來說,它具有與其主要和次要叢集關聯的 AWS 區域,如下面的螢幕擷取畫面所示。

此螢幕擷取畫面顯示 AWS Management Console 中已選取的 Aurora 全域資料庫及其組態設定。

當您對 Aurora 全域資料庫進行變更時,您有機會取消更改,如下面的螢幕擷取畫面。

此螢幕擷取畫面顯示的頁面用來修改 Aurora 全球資料庫的設定。

當您選擇 Continue (繼續) 時,您可以確認變更。

修改 Aurora 全域資料庫的參數

您可以為 Aurora 全域資料庫內的每個 Aurora 叢集,單獨地設定 Aurora 資料庫叢集參數群組。大部分參數的作用就如同用在其他類型的 Aurora 叢集一樣。建議您將全域資料庫中所有叢集的設定保持一致。如果您將次要叢集提升為主要叢集,這麼做有助於避免非預期的行為變更。

例如,讓時區和字元集使用相同設定,以避免不同叢集接管成為主要業集時發生不一致的行為。

aurora_enable_repl_bin_log_filteringaurora_enable_replica_log_compression 組態設定沒有效果。

從 Amazon Aurora 全域資料庫中移除叢集

您可以根據幾個不同的原因,從 Aurora 全域資料庫中移除 Aurora 資料庫叢集。例如,如果主要叢集降級或隔離,您可能想要從 Aurora 全域資料庫移除 Aurora 資料庫叢集。接著它會變為獨立佈建的 Aurora 資料庫叢集,可用於建立新的 Aurora 全域資料庫。如需進一步了解,請參閱從計劃外中斷復原 Amazon Aurora 全域資料庫

您也可能想要移除 Aurora 資料庫叢集,因為您想要刪除不再需要的 Aurora 全域資料庫。您無法刪除 Aurora 全域資料庫,直至刪除 (分離) 所有關聯的 Aurora 資料庫叢集之後,將主要資料庫叢集設定為最後刪除。如需更多詳細資訊,請參閱 刪除 Amazon Aurora 全域資料庫

當 Aurora 資料庫叢集從 Aurora 全域資料庫分離時,它不再與主要資料庫叢集保持同步。它會成為具有完整讀取/寫入功能的獨立佈建 Aurora 資料庫叢集。

您可以使用 AWS Management Console、AWS CLI 或 RDS API 從 Aurora 全域資料庫移除 Aurora 資料庫叢集。

從 Aurora 全球資料庫中移除 Aurora 叢集
  1. 登入 AWS Management Console,開啟位於 https://console.aws.amazon.com/rds/ 的 Amazon RDS 主控台。

  2. Databases (資料庫) 頁面上選擇叢集。

  3. 對於 Actions (動作),選擇 Remove from Global (從全球移除)。

    此螢幕擷取畫面顯示已選取的 Aurora 資料庫叢集 (次要) 和 Remove from global (從全域移除) 動作。

    您會看到一個提示,以確認您要從 Aurora 全域資料庫卸離次要叢集。

    此螢幕擷取畫面顯示從 Aurora 全球資料庫移除次要叢集時的確認提示。
  4. 選擇 Remove and promote (移除並升級),即可從全域資料庫移除叢集。

Aurora 資料庫叢集不再用作 Aurora 全域資料庫中的次要叢集,且不再與主要資料庫叢集同步。它是一個獨立的 Aurora 資料庫叢集,具有完整的讀取/寫入功能。

此螢幕擷取畫面顯示從 Aurora 全球資料庫移除次要叢集時的確認提示。

移除或刪除所有次要叢集之後,您就可以用同樣的方式移除主要叢集。在移除所有次要叢集之前,您無法從 Aurora 全域資料庫中卸離 (移除) 主要 Aurora 資料庫叢集。

Aurora 全域資料庫可能會保留在 Databases (資料庫) 清單中,其中包含零個區域和可用區域。如果您不想再使用此 Aurora 全域資料庫,您可以刪除。如需詳細資訊,請參閱刪除 Amazon Aurora 全域資料庫

若要從 Aurora 全域資料庫移除 Aurora 叢集,請使用下列參數執行 remove-from-global-clusterCLI 命令:

  • --global-cluster-identifier – Aurora 全域資料庫的名稱 (識別符)。

  • --db-cluster-identifier – 要從 Aurora 全域資料庫中移除的每個 Aurora 資料庫叢集的名稱。移除主要資料庫叢集之前,請先移除所有次要 Aurora 資料庫叢集

下列範例從 Aurora 全域資料庫中先移除次要叢集,然後移除主要叢集。

對於LinuxmacOS、或Unix:

aws rds --region secondary_region \ remove-from-global-cluster \ --db-cluster-identifier secondary_cluster_ARN \ --global-cluster-identifier global_database_id aws rds --region primary_region \ remove-from-global-cluster \ --db-cluster-identifier primary_cluster_ARN \ --global-cluster-identifier global_database_id

針對 Aurora 全域資料庫中的每個次要 AWS 區域,重複此 remove-from-global-cluster --db-cluster-identifier secondary_cluster_ARN 命令。

在Windows中:

aws rds --region secondary_region ^ remove-from-global-cluster ^ --db-cluster-identifier secondary_cluster_ARN ^ --global-cluster-identifier global_database_id aws rds --region primary_region ^ remove-from-global-cluster ^ --db-cluster-identifier primary_cluster_ARN ^ --global-cluster-identifier global_database_id

針對 Aurora 全域資料庫中的每個次要 AWS 區域,重複此 remove-from-global-cluster --db-cluster-identifier secondary_cluster_ARN 命令。

若要使用 RDS API 從 Aurora 全域資料庫移除 Aurora 叢集,請執行該RemoveFromGlobalCluster動作。

刪除 Amazon Aurora 全域資料庫

因為 Aurora 全域資料庫通常包含關鍵業務資料,您不能在單一步驟中刪除全域資料庫和相關聯的叢集。若要刪除 Aurora 全域資料庫,請執行下列動作:

  • 從 Aurora 全域資料庫移除所有次要資料庫叢集。每個叢集都會變成獨立 Aurora 資料庫叢集。若要瞭解如何操作,請參閱從 Amazon Aurora 全域資料庫中移除叢集

  • 從每個獨立 Aurora 資料庫叢集中,刪除所有 Aurora 複本。

  • 從 Aurora 全域資料庫移除主要資料庫叢集。這會成為獨立 Aurora 資料庫叢集。

  • 從 Aurora 主要資料庫叢集中,先刪除所有 Aurora 複本,然後刪除寫入器資料庫執行個體。

從新獨立的 Aurora 資料庫叢集刪除寫入器執行個體,通常也會移除 Aurora 資料庫叢集和 Aurora 全域資料庫。

如需一般詳細資訊,請參閱從 Aurora 個體資料庫叢集刪除資料庫執行個體

若要刪除 Aurora 全域資料庫,您可以使用 AWS Management Console、AWS CLI 或 RDS API。

刪除 Aurora 全域資料庫
  1. 登入 AWS Management Console,開啟位於 https://console.aws.amazon.com/rds/ 的 Amazon RDS 主控台。

  2. 選擇 Databases (資料庫),然後在清單中尋找您要刪除的 Aurora 全域資料庫。

  3. 請確認已從 Aurora 全域資料庫中移除所有叢集。Aurora 全域資料庫應顯示 0 個區域和可用區域,以及大小為 0 的叢集。

    如果 Aurora 全域資料庫包含任何 Aurora 資料庫叢集,則無法將其刪除。如有必要,請從 Aurora 全域資料庫中卸離主要和次要 Aurora 資料庫叢集。如需更多詳細資訊,請參閱 從 Amazon Aurora 全域資料庫中移除叢集

  4. 在清單中選擇您的 Aurora 全球資料庫,然後從動作功能表中選擇刪除

    基於 Aurora MySQL 5.6.10a 的 Aurora 全域資料庫保留在 AWS Management Console 中,直到您將其刪除,即使它沒有任何關聯的 Aurora 資料庫叢集。

若要刪除 Aurora 全域資料庫,請使用名稱AWS 區域和 Aurora 全域資料庫識別碼執行 delete-global-clusterCLI 命令,如下列範例所示。

對於LinuxmacOS、或Unix:

aws rds --region primary_region delete-global-cluster \ --global-cluster-identifier global_database_id

在Windows中:

aws rds --region primary_region delete-global-cluster ^ --global-cluster-identifier global_database_id

若要刪除屬於 Aurora 全域資料庫一部分的叢集,請執行 DeleteGlobalClusterAPI 作業。