通过私有网络连接到 Application Migration Service 数据和控制面板 - AWS Prescriptive Guidance

通过私有网络连接到 Application Migration Service 数据和控制面板

Dipin Jain 和 Mike Kuznetsov,Amazon Web Services

摘要

此模式说明了如何使用接口 VPC 端点连接到私有安全网络上的 AWS Application Migration Service 数据面板和控制面板。

Application Migration Service 是一款高度自动化的直接迁移(重新托管)解决方案,可简化、加速将应用程序迁移到 AWS 并降低迁移成本。它使公司能够重新托管大量物理、虚拟或云服务器,而不会出现兼容性问题、性能中断或长时间的割接窗口。Application Migration Service 可从 AWS 管理控制台 获取。另外,该解决方案可以与其他 AWS 服务 的无缝集成,例如 AWS CloudTrail、Amazon CloudWatch 和 AWS Identity and Access Management(IAM)。

您可以使用 Site-to-Site VPN 服务、AWS Direct Connect 或 Application Migration Service 中的 VPC 对等连接,通过私有连接从源数据中心连接到数据面板(即,连接到充当目标 VPC 中数据复制暂存区的子网)。您还可以使用由 AWS PrivateLink 提供支持的接口 VPC 端点通过私有网络连接到 Application Migration Service 控制面板。 

先决条件和限制

先决条件

  • 暂存区子网 – 在设置 Application Migration Service 之前,创建一个子网,用作从源服务器复制到 AWS 的数据的暂存区(即数据面板)。首次访问 Application Migration Service 控制台时,必须在复制设置模板中指定此子网。您可以在“复制设置”模板中为特定源服务器覆盖此子网。尽管您可以使用 AWS 账户 中的现有子网,但我们建议您为此创建一个新的专用子网。

  • 网络要求 – Application Migration Service 在您的暂存区子网中启动的复制服务器必须能够将数据发送到位于 https://mgn.<region>.amazonaws.com/ 的 Application Migration Service API 端点,其中 <region> 是您要复制到的 AWS 区域 的代码(例如,https://mgn.us-east-1.amazonaws.com)。下载 Application Migration Service 软件需要 Amazon Simple Storage Service(Amazon S3)服务 URL。

    • AWS Replication Agent 安装程序应有权访问您用于 Application Migration Service 的 AWS 区域 的 Amazon Simple Storage Service(Amazon S3)存储桶 URL。

    • 暂存区子网应有权访问 Amazon S3。

    • 安装了 AWS Replication Agent 的源服务器必须能够将数据发送到暂存区子网中的复制服务器和位于 https://mgn.<region>.amazonaws.com/ 的 Application Migration Service API 端点。

下表列出了所需端口。

来源

目标

端口

有关更多信息,请参阅

源数据中心

Amazon S3 服务 URL

443(TCP)

通过 TCP 端口 443 进行通信

源数据中心

Application Migration Service 的 AWS 区域 特定控制台地址

443(TCP)

源服务器与 Application Migration Service 之间通过 TCP 端口 443 进行通信

源数据中心

暂存区子网

1500 (TCP)

源服务器与暂存区子网之间通过 TCP 端口 1500 进行通信

暂存区子网

Application Migration Service 的 AWS 区域 特定控制台地址

443(TCP)

暂存区子网与 Application Migration Service 之间通过 TCP 端口 443 进行通信

暂存区子网

Amazon S3 服务 URL

443(TCP)

通过 TCP 端口 443 进行通信

暂存区子网

子网的 AWS 区域 的 Amazon Elastic Compute Cloud(Amazon EC2)端点

443(TCP)

通过 TCP 端口 443 进行通信

限制

Application Migration Service 目前并非在所有 AWS 区域 和操作系统中均可用。

架构

下图展示了典型迁移的网络架构。有关此架构的更多信息,请参阅 Application Migration Service 文档Application Migration Service 架构和网络架构视频

典型迁移的 Application Migration Service 的网络架构

以下详细视图显示了暂存区 VPC 中用于连接 Amazon S3 和 Application Migration Service 的接口 VPC 端点的配置。

典型迁移的 Application Migration Service 的网络架构 - 详细视图

工具

  • AWS Application Migration Service 可简化、加速重新托管 AWS 上的应用程序,并降低重新托管的成本。

  • 接口 VPC 端点使您能够连接到由 AWS PrivateLink 提供支持的服务,而无需互联网网关、NAT 设备、VPN 连接或 AWS Direct Connect 连接。VPC 中的实例无需公有 IP 地址便可与服务中的资源通信。VPC 和其他服务之间的通信不会离开 Amazon 网络。

操作说明

任务描述所需技能

为 Application Migration Service 配置接口端点。

源数据中心和暂存区 VPC 通过您在目标暂存区 VPC 中创建的接口端点以私有方式连接到 Application Migration Service 控制面板。要创建端点:

  1. 打开 Amazon Virtual Private Cloud(Amazon VPC)控制台

  2. 在导航窗格中,选择端点创建端点

  3. 对于 Service category(服务类别),选择 AWS 服务

  4. 对于服务名称,输入 com.amazonaws.<region>.mgn。对于类型,选择接口

  5. 对于 VPC,选择要在其中创建端点的目标暂存区 VPC。 

  6. 对于子网,选择要在其中创建端点网络接口的子网。

  7. 要为接口端点启用私有 DNS,请在其他设置部分中选择启用 DNS 名称

  8. 选择允许通过 TCP 443 从暂存区 VPC 子网进入的安全组。

  9. 选择创建端点

有关更多信息,请参阅 Amazon VPC 文档中的使用接口 VPC 端点访问 AWS 服务

迁移主管

配置 Amazon EC2 的接口端点。

暂存区 VPC 通过您在目标暂存区 VPC 中创建的接口端点私下连接到 Amazon EC2 API。若要创建端点,请按照上一篇文章中提供的说明进行操作。

  • 对于服务名称,输入 com.amazonaws.<region>.ec2。对于类型,选择接口

  • 安全组必须允许来自暂存区 VPC 子网的入站 HTTPS 流量通过端口 443。

  • 其他设置部分中,选择启用 DNS 名称

迁移主管

配置 Amazon S3 的接口端点。

源数据中心和暂存区 VPC 通过您在目标暂存区 VPC 中创建的接口端点以私有方式连接到 Amazon S3 API。若要创建端点,请按照第一篇文章提供中的说明进行操作。

  • 对于服务名称,输入 com.amazonaws.<region>.s3。对于类型,选择接口

  • VPC 安全组必须允许来自暂存区 VPC 子网的入站 HTTPS 流量通过端口 443。

  • 其他设置部分中,清除启用 DNS 名称。Amazon S3 接口端点不支持私有 DNS 名称。 

注意

您使用接口端点是因为网关端点连接无法扩展到 VPC 之外。(有关详细信息,请参阅 AWS PrivateLink 文档。)

迁移主管

配置 Amazon S3 网关端点。

在配置阶段,复制服务器必须连接到 S3 存储桶才能下载 AWS Replication Server 的软件更新。但是,Amazon S3 接口端点不支持私有 DNS 名称并且无法向复制服务器提供 Amazon S3 端点 DNS 名称。 

要缓解此问题,请在暂存区子网所属的 VPC 中创建一个 Amazon S3 网关端点,并使用相关路由更新暂存子网的路由表。有关更多信息,请参阅 AWS PrivateLink 文档中的创建网关端点

云管理员

配置本地 DNS 以解析端点的私有 DNS 名称。

Application Migration Service 和 Amazon EC2 的接口端点具有可在 VPC 中解析的私有 DNS 名称。但是,您还需要配置本地服务器以解析这些接口端点的私有 DNS 名称。

配置这些服务器有多种方法。在此模式中,我们通过将本地 DNS 查询转发到暂存区 VPC 中的 Amazon Route 53 Resolver 入站端点来测试此功能。有关更多信息,请参阅 Route 53 文档中的解析 VPC 和您的网络之间的 DNS 查询

迁移工程师
任务描述所需技能

使用 AWS PrivateLink 安装 AWS Replication Agent。

  1. 将 AWS Replication Agent 下载到目标区域中的私有 S3 存储桶。

  2. 登录待迁移的源服务器。AWS Replication Agent 安装程序需要对 Application Migration Service 和 Amazon S3 端点进行网络访问。由于您的本地网络不对 Application Migration Service 和 Amazon S3 公有端点开放,因此您必须借助在前面步骤中使用 AWS PrivateLink 创建的接口端点来安装代理。

以下是 Linux 的示例:

  1. 使用以下命令下载代理:

    wget -O ./aws-replication-installer-init.py \ https://aws-application-migration-service-<aws_region>.bucket.<s3-endpoint-DNS-name>/latest/linux/aws-replication-installer-init.py

    例如,如果 Amazon S3 接口端点的 DNS 名称为 vpce-009c8b07adb052a11-qgf8q50y.s3.us-west-1.vpce.amazonaws.com,而 AWS 区域 为 us-west-1,则您可以使用以下命令:

    wget -O ./aws-replication-installer-init.py \ https://aws-application-migration-service-us-west-1.bucket.vpce-009c8b07adb052a11-qgf8q50y.s3.us-west-1.vpce.amazonaws.com/latest/linux/aws-replication-installer-init.py
    注意

    bucket 是您必须在 Amazon S3 接口端点 DNS 名称之前添加的静态关键字。有关更多信息,请参阅 Amazon S3 文档

  2. 安装代理:

    • 如果您在为 Application Migration Service 创建接口端点时选择了启用 DNS 名称,请运行以下命令:

      sudo python3 aws-replication-installer-init.py \ --region <aws_region> \ --aws-access-key-id <access-key> \ --aws-secret-access-key <secret-key> \ --no-prompt \ --s3-endpoint <s3-endpoint-DNS-name>
    • 如果您在为 Application Migration Service 创建接口端点时未选择启用 DNS 名称,请运行以下命令:

      sudo python3 aws-replication-installer-init.py \ --region <aws_region> \ --aws-access-key-id <access-key> \ --aws-secret-access-key <secret-key> \ --no-prompt \ --s3-endpoint <s3-endpoint-DNS-name> \ --endpoint <mgn-endpoint-DNS-name>

    有关更多信息,请参阅 Application Migration Service 文档中的 AWS Replication Agent 安装说明

在与 Application Migration Service 建立连接并安装 AWS Replication Agent 后,请按照 Application Migration Service 文档中的说明将源服务器迁移到目标 VPC 和子网。

迁移工程师

相关资源

Application Migration Service 文档

其他资源

其他信息

对 Linux 服务器上的 AWS Replication Agent 安装进行问题排查

如果您在 Amazon Linux 服务器上收到 gcc 错误,请配置软件包存储库并使用以下命令:

## sudo yum groupinstall "Development Tools"