创建手动集群快照 - Amazon DocumentDB
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

创建手动集群快照

您可以使用 Amazon Web Services Management Console 或创建手动快照 Amazon CLI。创建快照所用时间因数据库大小而异。在创建快照时,您必须执行以下操作:

  1. 确定要备份的集群。

  2. 为快照指定名称。这样,您以后便可从中还原。

Using the Amazon Web Services Management Console

要使用创建手动快照 Amazon Web Services Management Console,您可以按照以下任一方法进行操作。

  1. 方法 1:

    1. 登录并打开亚马逊 DocumentDB 控制台,网址为 https://console.aws.amazon.com/docdb。 Amazon Web Services Management Console

    2. 在导航窗格中,选择快照

      提示

      如果您在屏幕左侧没有看到导航窗格,请在页面左上角选择菜单图标 ()。

    3. Snapshots (快照) 页面上,选择 Create (创建)

    4. Create cluster snapshot (创建集群快照) 页面上:

      1. 集群标识符 — 从集群的下拉列表中,选择要为其创建快照的集群。

      2. 快照标识符 — 输入快照的名称。

        快照命名约束:

        • 长度为 [1–255] 个字母、数字或连字符。

        • 第一个字符必须是字母。

        • 不能以连字符结束或包含两个连续连字符。

        • 对于每个区域的每个 Amazon 账户的所有集群(跨 Amazon RDS、Amazon Neptune 和 Amazon DocumentDB)必须是唯一的。

      3. 选择 创建

  2. 方法 2:

    1. 登录并打开亚马逊 DocumentDB 控制台,网址为 https://console.aws.amazon.com/docdb。 Amazon Web Services Management Console

    2. 在导航窗格中,选择集群

      提示

      如果您在屏幕左侧没有看到导航窗格,请在页面左上角选择菜单图标 ()。

    3. Clusters (集群) 页面上,选择要拍摄快照的集群左侧的按钮。

    4. Actions (操作) 菜单中,选择 Take snapshot (拍摄快照)

    5. Create cluster snapshot (创建集群快照) 页面上:

      1. 快照标识符 — 输入快照的名称。

        快照命名约束:

        • 长度为 [1–63] 个字母、数字或连字符。

        • 第一个字符必须是字母。

        • 不能以连字符结束或包含两个连续连字符。

        • 对于每个区域的每个 Amazon 账户的所有集群(跨 Amazon RDS、Amazon Neptune 和 Amazon DocumentDB)必须是唯一的。

      2. 选择 创建

Using the Amazon CLI

要使用创建集群快照 Amazon CLI,请使用带有以下参数的create-db-cluster-snapshot操作。

参数
  • --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" } }