Get Hands-on with Amazon EKS - Workshop Event Series
Whether you're taking your first steps with Kubernetes or you're an experienced practitioner looking to sharpen your skills, our Amazon EKS workshop series delivers practical, real-world experience that moves you forward. Learn directly from AWS solutions architects and EKS specialists through hands-on sessions designed to build your confidence with Kubernetes. Register now and start building with Amazon EKS!
如何对 Windows Server 上的 AWS Replication Agent 安装失败问题进行故障排除?
为 AWS Application Migration Service 或 AWS 弹性灾难恢复安装 AWS Replication Agent 失败。我使用运行 Microsoft Windows 的 Amazon Elastic Compute Cloud (Amazon EC2) 实例,或者运行 Windows Server 的本地计算机。
简短描述
必须在每台源服务器上为 Application Migration Service 和弹性灾难恢复安装 AWS Replication Agent。您可能会遇到以下安装失败错误:
- “CERTIFICATE_VERIFY_FAILED”
- “Downloading of path/AwsReplicationInstaller.exe failed.”
- “ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host {change”
- “invoke-webrequest : The underlying connection was closed: An unexpected error occurred on a send.”
- “No permission to install”
- “This agent installer is not suitable for the current operating system”
- “Agent installation failed with "Unexpected Error”
- “The service cannot be started, either because it is disabled or because it has no enabled devices associated with it.', None, None) Failed to execute script install_agent_windows”
- “Agent installation fails of freezes when using the "--force-volumes" flag to specify disks”
- “[WinError 740] The requested operation requires elevation”
- “MissingDotNetVersionException”
- “UninitializedAccountException”
- “AccessDeniedException”
解决方法
根据您收到的错误,执行以下故障排除操作。
“CERTIFICATE_VERIFY_FAILED”
当因缺少 Amazon 根证书颁发机构 (CA) 证书而导致 AWS Replication Agent 安装失败时,就会出现此错误。您必须拥有 Amazon 根 CA 证书才能向 AWS 管理控制台进行身份验证。
要解决此错误,请完成以下步骤:
- 下载 Amazon 根 CA 证书。
- 将 Amazon 根 CA 证书导入“可信根证书颁发机构”文件夹。有关说明,请参阅 Microsoft 网站上的安装可信根证书。
“Downloading of path/AwsReplicationInstaller.exe failed”
此错误表示源实例连接到以下所需服务端点时出现联网错误:
要对连接错误进行故障排除,请打开 PowerShell,然后运行以下命令来测试与每个端点的端口 443 连接。
Amazon S3:
Test-NetConnection s3.us-east-1.amazonaws.com -Port 443
Application Migration Service:
Test-NetConnection mgn.us-east-1.amazonaws.com -Port 443
弹性灾难恢复:
Test-NetConnection drs.us-east-1.amazonaws.com -Port 443
**注意:**将 us-east-1 替换为您用于 Application Migration Service 或弹性灾难恢复的 AWS 区域。
您还必须在本地环境和 Application Migration Service 或弹性灾难恢复所需的端点之间配置所有代理。
如果您的本地网络未对所需的服务端点开放,则使用 AWS PrivateLink 安装 Application Migration Service 或弹性灾难恢复的代理。
“ConnectionResetError: [WinError 10054]" or "invoke-webrequest : The underlying connection was closed”
当客户端无法与 Application Migration Service 或弹性灾难恢复服务端点握手时,就会出现这些错误。当客户端尝试使用 TLS 1.0 或 TLS 1.1 进行连接时,会出现此问题。大多数 AWS 端点只能使用 TLS 1.2 协议。
要解决此问题,请执行以下操作:
- 为服务器和客户端子键启用 TLS 1.2。
- 通过注册表停用 TLS 1.0、TLS 1.1 和其他 SSL 版本。
有关说明,请参阅 Oracle 网站上的 Configuring registry settings for TLS 1.2(配置 TLS 1.2 的注册表设置)。
更改 TLS 设置后,重新启动服务器,然后重试安装。
当您使用 Invoke-WebRequest 下载代理安装程序时,如果使用过期的安全协议,则会遇到错误。当目标端点需要 TLS 1.2,但客户端的脚本或会话未强制执行此协议时,就会出现此问题。
要强制执行 TLS 1.2,请运行以下命令:
[System.Net.ServicePointManager]::SecurityProtocol = 'TLS12'
然后,重试安装。
“No permission to install”
当安装 AWS Replication Agent 的用户没有管理员域权限时,就会出现此错误。如果防病毒软件阻止安装,也会出现此错误。
要解决此错误,请执行以下操作:
- 以管理员身份打开命令提示符或 PowerShell。
- 将 C:\Program Files (x86)\AWS Replication Agent\ 添加到防病毒软件的允许列表目录中。
**注意:**要检查防病毒软件是否阻止安装,请在安装 AWS Replication Agent 时暂时将其停用。
“This agent installer is not suitable for the current operating system”
当您为当前源计算机的操作系统 (OS) 安装错误的 AWS Replication Agent 版本时,就会出现此错误。Windows Server 版本 2003、2003 R2、2008、2008 R2、2012 和 2012 R2 使用的唯一代理版本仅对旧版 Windows 操作系统有效。
对于 2003、2003 R2、2008、2008 R2,请使用 AwsReplicationWindowsLegacyInstaller.exe 安装程序。
对于 2012 和 2012 R2,请使用 AwsReplicationWindows2012LegacyInstaller.exe 安装程序。
有关详细信息,请参阅 Installing the AWS Replication Agent on Windows servers(在 Windows 服务器上安装 AWS Replication Agent)。
“Agent installation failed with "Unexpected Error"”
当您使用无效的凭证或用户的凭证缺乏所需权限时,就会出现此错误。
要解决此错误,请确保您的 AWS 账户中存在您使用的 AWS Identity and Access Management (IAM) 角色。此外,请确保该角色具有 Application Migration Service 或弹性灾难恢复所需的策略。
如果权限正确但您仍然收到错误,请查看安装日志进一步解决问题。您可以在 install_path\aws_replication_agent_installer.log 文件路径中找到安装日志。
“The service cannot be started...Failed to execute script install_agent_windows”
要使用 AWS Replication Agent,必须启用 Windows Management Instrumentation (WMI) 服务。如果 WMI 未按预期运行,则会在日志中收到一条与以下示例类似的错误消息:
File "install_agent_windows.py", line 28, in <module> File "c:\python27\Lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 389, in load_module File "installer_utils\init.py", line 5, in <module> File "c:\python27\Lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 389, in load_module File "installer_utils\cloud_utils.py", line 34, in <module> File "c:\python27\Lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 389, in load_module File "installer_utils\instance_id_utils.py", line 41, in <module> File "c:\python27\Lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 389, in load_module File "site-packages\wmi.py ", line 157, in <module> File "site-packages\win32com\client\init.py", line 72, in GetObject File "site-packages\win32com\client\init.py", line 87, in Moniker pywintypes.com_error: (-2147023838, 'The service cannot be started, either because it is disabled or because it has no enabled devices associated with it.', None, None) Failed to execute script install_agent_windows"
要解决此问题,请在源计算机上启用 WMI 服务。有关说明,请参阅 Microsoft 网站上的设置远程 WMI 连接。有关 WMI 的详细信息,请参阅 Microsoft 网站上的 Windows Management Instrumentation。
“Agent installation fails or freezes when using the "--force-volumes" flag to specify disks”
当您未按正确的顺序描述磁盘时,就会出现此错误。使用 --force-volumes 标志时,必须先列出根磁盘。在以下示例命令中,PhysicalDisk1 为根磁盘:
AwsReplicationWindowsInstaller.exe --region destination-region --aws-access-key-id your-access-key --aws-secret-access-key your-secret-access-key --force-volumes --drives=\\.\PHYSICALDRIVE1,\\.\PHYSICALDRIVE0 --no-prompt
**注意:**将 destination-region 替换为目标区域。此外,将 your-access-key 替换为用于安装代理的访问密钥,将 your-secret-access-key 替换为用于安装代理的秘密访问密钥。有关如何创建访问密钥和秘密访问密钥的信息,请参阅生成所需的 AWS 凭证 (Application Migration Service) 或生成所需的 AWS 凭证(弹性灾难恢复)。
要检查您的磁盘名称,请运行以下命令:
wmic diskdrive list brief
“[WinError 740] The requested operation requires elevation”
当没有管理权限的用户尝试安装软件时,就会出现此错误。您必须具有管理权限才能安装和使用 AWS Replication Agent。
要以管理员权限运行代理安装程序文件,请打开上下文菜单(右键单击)AWSReplicationWindowsInstaller.exe,然后选择 Run as Administrator(以管理员身份运行)。
“MissingDotNetVersionException”
如果您在代理安装程序日志中看到“MissingDotNetVersionException”,则服务器缺少所需的 .Net 框架。
要解决此问题,请执行以下操作:
-
如果您使用 Windows Server 2008 R2 或更高版本,请确保已在服务器上安装 .NET Framework version 4.5 或更高版本。有关说明,请参阅 Microsoft 网站上的 How to: Determine which .NET Framework versions are installed(操作指南:确定已安装的 .NET Framework 版本)。
-
要检查 .NET Framework 版本,请运行以下命令来检查所需的注册表项:
reg query "HKEY_LOCAL_MACHINE\Software\Microsoft\NET Framework Setup\NDP\v4\full" reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full" /v "Release" -
确认您的组策略不会阻止 .NET 安装或对所需注册表项的查询。
“UninitializedAccountException”
如果您未使用 Application Migration Service 或弹性灾难恢复初始化账户,就会出现此错误。如果账户不使用默认复制模板,也会出现此错误。
复制设置决定了服务如何将数据从源服务器复制到 AWS。在安装代理之前,必须为 Application Migration Service或弹性灾难恢复配置这些设置。
“AccessDeniedException”
此问题是由于缺少权限而发生的。确认您已将具有所需权限的 IAM 策略附加到用于安装代理的 IAM 角色或用户。
对于 Application Migration Service,请附加 AWSApplicationMigrationAgentInstallationPolicy。如果您的源服务器为 Amazon Elastic Compute Cloud (Amazon EC2) 实例,请附加 AWSApplicationMigrationServiceEc2InstancePolicy。
有关 Application Migration Service 权限的详细信息,请参阅生成所需的 AWS 凭证。
对于弹性灾难恢复,请附加 AWSElasticDisasterRecoveryAgentInstallationPolicy。如果您的源为 Amazon EC2 实例,请附加 AWSElasticDisasterRecoveryEc2InstancePolicy。
有关弹性灾难恢复权限的详细信息,请参阅生成所需的 AWS 凭证。
此外,请确保服务控制策略 (SCP) 不会阻止或拒绝 Application Migration Service 或弹性灾难恢复所需的 API 操作。
