

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

# 從 Amazon Aurora 全域資料庫中移除叢集
<a name="aurora-global-database-detaching"></a>

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

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

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

您可以使用 AWS 管理主控台、AWS CLI 或 RDS API 從 Aurora 全域資料庫移除 Aurora 資料庫叢集。

## 主控台
<a name="aurora-global-database-detach.console"></a>

**從 Aurora 全球資料庫中移除 Aurora 叢集**

1. 登入 AWS 管理主控台，開啟位於 [https://console.aws.amazon.com/rds/](https://console.aws.amazon.com/rds/) 的 Amazon RDS 主控台。

1. 在 **Databases** (資料庫) 頁面上選擇叢集。

1. 對於 ** Actions** (動作)，選擇 ** Remove from Global** (從全球移除)。  
![\[此螢幕擷取畫面顯示已選取的 Aurora 資料庫叢集 (次要) 和 Remove from global (從全域移除) 動作。\]](http://docs.aws.amazon.com/zh_tw/AmazonRDS/latest/AuroraUserGuide/images/aurora-global-db-detach-secondary-01.png)

   您會看到一個提示，以確認您要從 Aurora 全域資料庫卸離次要叢集。  
![\[此螢幕擷取畫面顯示從 Aurora 全球資料庫移除次要叢集時的確認提示。\]](http://docs.aws.amazon.com/zh_tw/AmazonRDS/latest/AuroraUserGuide/images/aurora-global-db-detach-secondary-02.png)

1. 選擇 **Remove and promote** (移除並升級)，即可從全域資料庫移除叢集。

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

![\[此螢幕擷取畫面顯示從 Aurora 全球資料庫移除次要叢集時的確認提示。\]](http://docs.aws.amazon.com/zh_tw/AmazonRDS/latest/AuroraUserGuide/images/aurora-global-db-detach-secondary-03.png)


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

Aurora 全域資料庫可能會保留在 **Databases** (資料庫) 清單中，其中包含零個區域和可用區域。如果您不想再使用此 Aurora 全域資料庫，您可以刪除。如需更多詳細資訊，請參閱 [刪除 Amazon Aurora 全域資料庫](aurora-global-database-deleting.md)。

## AWS CLI
<a name="aurora-global-database-detach.cli"></a>

 若要從 Aurora 全域資料庫移除 Aurora 叢集，請使用下列參數執行 [remove-from-global-cluster](https://docs.aws.amazon.com/cli/latest/reference/rds/remove-from-global-cluster.html) CLI 命令：
+ `--global-cluster-identifier` – Aurora 全域資料庫的名稱 (識別符)。
+ `--db-cluster-identifier` – 要從 Aurora 全域資料庫中移除的每個 Aurora 資料庫叢集的名稱。移除主要資料庫叢集之前，請先移除所有次要 Aurora 資料庫叢集 

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

對於 Linux、macOS 或 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
<a name="aurora-global-database-detach.api"></a>

 若要使用 RDS API 從 Aurora 全球資料庫中移除 Aurora 叢集，請執行 [RemoveFromGlobalCluster](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_RemoveFromGlobalCluster.html) 動作。