

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

# 还原 Neptune 集群
<a name="restoring-nep"></a>

## 使用 AWS Backup 控制台恢复 Amazon Neptune 恢复点
<a name="nep-restore-console"></a>

还原 Amazon Neptune 数据库需要指定多个还原选项。有关这些选项的信息，请参阅《Neptune 用户指南》**中的[从数据库集群快照还原](https://docs.aws.amazon.com/neptune/latest/userguide/backup-restore-restore-snapshot.html)。

**还原 Neptune 数据库**

1. 在 [https://console.aws.amazon.com/backup](https://console.aws.amazon.com/backup) 上打开 AWS Backup 控制台。

1. 在导航窗格中，选择**受保护的资源**和要还原的 Neptune 资源 ID。

1. 在 **Resource details (资源详细信息)** 页面上，将显示所选资源 ID 的恢复点列表。要还原资源，请在**备份**窗格中，选择资源的恢复点 ID 旁边的单选按钮。在窗格的右上角，选择**还原**。

1. 在**实例规格**窗格中，接受默认值或指定**数据库引擎**和**版本**。

1. 在**设置**窗格中，为当前区域中您拥有的所有数据库集群实例指定一个唯一 AWS 账户 的名称。数据库集群标识符不区分大小写，但它以全小写形式存储，例如“`mydbclusterinstance`”。此字段为必填字段。

1. 在**数据库选项**窗格中，接受**数据库端口**、**数据库集群参数组**的默认值或指定这些选项。

1. 在**加密)** 窗格中，接受**启用加密**和**禁用加密**设置的默认值或指定这些选项。

1. 在**日志导出**窗格中，选择要发布到 Amazon Logs 的 CloudWatch 日志类型。已定义 **IAM 角色**。

1. 在**还原角色**窗格中，选择 AWS Backup 将为此还原担任的 IAM 角色。

1. 指定所有设置后，选择**还原备份**。

   这将显示**还原作业**窗格。页面顶部的消息提供了有关还原作业的信息。

1. 还原完成后，将还原的 Neptune 集群连接到 Amazon RDS 实例。

## 使用 AWS Backup API、CLI 或 SDK 恢复 Neptune 恢复点
<a name="nep-restore-cli"></a>

首先，还原您的集群。使用 `[StartRestoreJob](https://docs.aws.amazon.com/aws-backup/latest/devguide/API_StartRestoreJob.html)`。在 Amazon DocumentDB 还原期间，您可以指定以下元数据：

```
availabilityZones
backtrackWindow
copyTagsToSnapshot // Boolean 
databaseName // string 
dbClusterIdentifier // string 
dbClusterParameterGroupName // string 
dbSubnetGroupName // string 
enableCloudwatchLogsExports // string 
enableIAMDatabaseAuthentication // Boolean 
engine // string 
engineMode // string 
engineVersion // string 
kmsKeyId // string 
port // integer 
optionGroupName // string 
scalingConfiguration
vpcSecurityGroupIds // string
```

然后，使用 `create-db-instance` 将还原后的 Neptune 集群附加到 Amazon RDS 实例。
+ 对于 Linux、macOS 或 Unix：

  ```
  aws neptune create-db-instance --db-instance-identifier sample-instance \ 
                    --db-instance-class db.r5.large --engine neptune --engine-version 1.0.5.0 --db-cluster-identifier sample-cluster --region us-east-1
  ```
+ 对于 Windows：

  ```
  aws neptune create-db-instance --db-instance-identifier sample-instance ^
                    --db-instance-class db.r5.large --engine neptune --engine-version 1.0.5.0 --db-cluster-identifier sample-cluster --region us-east-1
  ```

有关更多信息，请参阅《Neptune Management API 参考》**中的 [https://docs.aws.amazon.com/neptune/latest/userguide/api-snapshots.html#RestoreDBClusterFromSnapshot](https://docs.aws.amazon.com/neptune/latest/userguide/api-snapshots.html#RestoreDBClusterFromSnapshot) 和《*Neptune CLI 指南》*中的 [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/neptune/restore-db-cluster-from-snapshot.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/neptune/restore-db-cluster-from-snapshot.html)。