

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

# 使用该 Neptune-Export 服务导出 Neptune 数据
<a name="export-service"></a>

您可以使用以下步骤使用该服务将数据从 Neptune 数据库集群导出到 Amazon S3： Neptune-Export 

## 安装 Neptune-Export 服务
<a name="export-service-install"></a>

使用 AWS CloudFormation 模板创建堆栈：

**要安装该 Neptune-Export 服务**

1. 通过选择下表中的 “启动 CloudFormation 堆**栈” 按钮之一，在 CloudFormation 主机上启动堆栈**：    
[See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_cn/neptune/latest/userguide/export-service.html)

1.  在 **Select Template** 页面上，选择 **Next**。

1. 在模板的**指定详细信息**页面上，设置以下参数：
   + **`VPC`**— 设置该 Neptune-Export 服务的最简单方法是将其安装在与您的 Neptune 数据库相同的 Amazon VPC 中。如果您想将其安装在单独的 VPC 中，则可以使用 V [PC 对等](https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html)连接在 Neptune 数据库集群的 VPC 和 Neptune-Export 服务 VPC 之间建立连接。
   + **`Subnet1`**— 该 Neptune-Export 服务必须安装在您的 VPC 的子网中，该子网允许从子网到互联网的出站 IPv4 HTTPS 流量。这样，该 Neptune-Export服务就可以调用 B [AWS atch API](https://aws.amazon.com/premiumsupport/knowledge-center/batch-job-stuck-runnable-status/) 来创建和运行导出作业。

     如果您使用 Neptune 文档[创建 Neptune 集群](get-started-create-cluster.md)页面上的 CloudFormation 模板创建了 Neptune 集群，则可以使用该堆栈的`PrivateSubnet1`和`PrivateSubnet2`输出来填充此参数和下一个参数。
   + **`Subnet2`** – VPC 中的第二个子网，允许从该子网到互联网的出站 IPv4 HTTPS 流量。
   + **`EnableIAM`**— 将其设置`true`为使用 AWS Identity and Access Management (IAM) 保护 Neptune-Endpoint API。我们建议您这样做。

     如果您启用 IAM 身份验证，则必须对针对端点的所有 HTTPS 请求进行 `Sigv4` 签名。您可以使用诸如 [awscurl](https://github.com/okigan/awscurl) 之类的工具来代表您签署请求。
   + **`VPCOnly`**— 将其设置为`true`生成导出终端节点 VPC-only，因此您只能从安装 Neptune-Export 服务的 VPC 中访问它。这将 Neptune-Export API 限制为只能在该 VPC 内使用。

     建议您将 `VPCOnly` 设置为 `true`。
   + **`NumOfFilesULimit `** – 在 `ulimits` 容器属性中为 `nofile` 指定一个介于 10000 到 1 百万之间的值。默认值为 10000，除非您的图形包含大量唯一标签，否则我们建议保留默认值。
   + **`PrivateDnsEnabled `**（布尔值）– 指示是否将私有托管区与指定的 VPC 关联。默认值为 `true`。

     在启用此标志的情况下创建 VPC 端点时，所有 API Gateway 流量都将通过 VPC 端点路由，并且公有 API Gateway 端点调用将被禁用。如果将 `PrivateDnsEnabled` 设置为 `false`，则启用公有 API Gateway 端点，但无法通过私有 DNS 端点连接 Neptune 导出服务。然后，您可以使用 VPC 端点的公有 DNS 端点来调用导出服务，详见[此处](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-private-api-test-invoke-url.html#apigateway-private-api-public-dns)。
   +  **`NeptuneExportVersion`** – 指定要使用的 Neptune 导出实用程序的版本。支持 `v1.1.11` 或以上的所有版本。版本 `v2.latest` 可用于自动接收次要更新。可用版本的完整列表以及补丁说明可以在开源[GitHub 版本](https://github.com/aws/neptune-export/releases)中找到。

1. 选择**下一步**。

1. 在**选项**页面上，选择**下一步**。

1. 在**审核**页面上，选中第一个复选框以确认 CloudFormation 将创建 IAM 资源。选中第二个复选框以确认新堆栈的 `CAPABILITY_AUTO_EXPAND`。
**注意**  
`CAPABILITY_AUTO_EXPAND` 明确确认在创建堆栈时将扩展宏，而无需事先审核。用户通常通过处理的模板创建更改集，以便在实际创建堆栈之前对宏所做的更改进行审核。有关更多信息，请参阅 CloudFormation [CreateStack](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_CreateStack.html) API。

   然后选择**创建**。

## 允许从以下地址访问 Neptune Neptune-Export
<a name="export-service-access-to-neptune"></a>

 Neptune-Export 安装完成后，更新您的 [Neptune VPC 安全组](get-started-vpc.md#security-vpc-security-group)以允许从中进行访问。 Neptune-Export创建 Neptune-Export CloudFormation 堆栈后，“**输出**” 选项卡将包含一个 `NeptuneExportSecurityGroup` ID。更新您的 Neptune VPC 安全组以允许从该 Neptune-Export 安全组进行访问。

## 允许从 VPC-based EC2 实例访问 Neptune-Export 终端节点
<a name="export-service-access-to-service"></a>

如果您创建了 Neptune-Export 终端节点 VPC-only，则只能从安装该 Neptune-Export 服务的 VPC 中访问该终端节点。要允许从 VPC 中的 Amazon EC2 实例进行连接，以便您可以从中调用 Neptune-Export API，请将 CloudFormation 堆栈`NeptuneExportSecurityGroup`创建的实例附加到该 Amazon EC2 实例。