View a markdown version of this page

建立手動叢集快照 - Amazon DocumentDB

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

建立手動叢集快照

您可以使用 AWS 管理主控台 或 建立手動快照 AWS CLI。建立快照所需的時間量因資料庫的大小而異。建立快照時,您必須執行下列作業:

  1. 找出要備份的叢集。

  2. 為您的快照命名。您稍後可用它來進行還原。

Using the AWS 管理主控台

若要使用 建立手動快照 AWS 管理主控台,您可以遵循下列任一方法。

  1. 方法 1:

    1. 登入 AWS 管理主控台,並在 https://https://console.aws.amazon.com/docdb 開啟 Amazon DocumentDB 主控台。

    2. 在導覽窗格中,選擇 Snapshots (快照)。

      提示

      如果畫面左側沒有出現導覽窗格,請選擇頁面左上角的功能表圖示 (Menu button.)。

    3. Snapshots (快照) 頁面選擇 Create (建立)

    4. Create cluster snapshot (建立叢集快照) 頁面:

      1. 叢集識別符 — 從叢集的下拉式清單中,選擇要建立快照的叢集。

      2. 快照識別符 — 輸入快照的名稱。

        快照命名限制條件:

        • 長度為 【1–255】 個字母、數字或連字號。

        • 第一個字元必須是字母。

        • 不能以連字號結尾,或包含兩個連續連字號。

        • 對於每個 AWS 區域每個帳戶的所有叢集 (跨 Amazon RDS、Amazon Neptune 和 Amazon DocumentDB),必須是唯一的。

      3. 選擇建立

  2. 方法 2:

    1. 登入 AWS 管理主控台,並在 https://https://console.aws.amazon.com/docdb 開啟 Amazon DocumentDB 主控台。

    2. 在導覽窗格中,選擇叢集

      提示

      如果畫面左側沒有出現導覽窗格,請選擇頁面左上角的功能表圖示 (Menu button.)。

    3. Clusters (叢集) 頁面,找到您要建立快照的叢集,並選擇叢集左側的按鈕。

    4. Actions (動作) 功能表上,選擇 Take snapshot (建立快照)

    5. Create cluster snapshot (建立叢集快照) 頁面:

      1. 快照識別符 — 輸入快照的名稱。

        快照命名限制條件:

        • 長度為 【1–63】 個字母、數字或連字號。

        • 第一個字元必須是字母。

        • 不能以連字號結尾,或包含兩個連續連字號。

        • 對於每個 AWS 區域每個帳戶的所有叢集 (跨 Amazon RDS、Amazon Neptune 和 Amazon DocumentDB),必須是唯一的。

      2. 選擇建立

Using the AWS CLI

若要使用 建立叢集快照 AWS CLI,請使用 create-db-cluster-snapshot操作搭配下列參數。

Parameters
  • --db-cluster-identifier – 必要。您正在建立快照的叢集名稱。此叢集必須存在並且為可用

  • --db-cluster-snapshot-identifier – 必要。您正在建立的手動快照名稱。

下列範例會為名為 sample-cluster 的叢集建立一個名為 sample-cluster-snapshot 的快照。

針對 Linux、macOS 或 Unix:

aws docdb create-db-cluster-snapshot \ --db-cluster-identifier sample-cluster \ --db-cluster-snapshot-identifier sample-cluster-snapshot

針對 Windows:

aws docdb create-db-cluster-snapshot ^ --db-cluster-identifier sample-cluster ^ --db-cluster-snapshot-identifier sample-cluster-snapshot

此操作的輸出將會如下所示。

{ "DBClusterSnapshot": { "AvailabilityZones": [ "us-east-1a", "us-east-1b", "us-east-1c" ], "DBClusterSnapshotIdentifier": "sample-cluster-snapshot", "DBClusterIdentifier": "sample-cluster", "SnapshotCreateTime": "2020-04-24T04:59:08.475Z", "Engine": "docdb", "Status": "creating", "Port": 0, "VpcId": "vpc-abc0123", "ClusterCreateTime": "2020-01-10T22:13:38.261Z", "MasterUsername": "master-user", "EngineVersion": "4.0.0", "SnapshotType": "manual", "PercentProgress": 0, "StorageEncrypted": true, "KmsKeyId": "arn:aws:kms:us-east-1:<accountID>:key/sample-key", "DBClusterSnapshotArn": "arn:aws:rds:us-east-1:<accountID>:cluster-snapshot:sample-cluster-snapshot" } }