如何排查 AWS DMS 和 MongoDB 源端点之间的连接故障?

2 分钟阅读
0

AWS Database Migration Service(AWS DMS)复制实例与我的 MongoDB 源端点之间的连接出现故障。如何排查将 MongoDB 作为源端点时出现的 Test Endpoint failed(测试端点故障)错误?

解决方法

MongoDB 源终端节点可能由于多种原因无法连接。请参阅以下常见错误及其解决方法。

连接超时调用错误

如果 AWS DMS 复制实例无法连接到指定的 MongoDB 数据库,您会收到以下错误:

Test Endpoint failed: Application-Status: 1020912, Application-Message: Failed to create new client connection Failed to connect to database., Application-Detailed-Message: Error verifying connection: 'No suitable servers found (`serverSelectionTryOnce` set): [connection timeout calling ismaster on 'mongodbtest.us-west-2.compute.amazonaws.com:27017']' Failed to connect to database.

当无法在 AWS DMS 复制实例与 MongoDB 数据库之间建立连接时,就会出现这个错误。大多数情况下,此错误是由安全组中的配置问题、网络访问控制列表(网络 ACL)或本地防火墙和 IP 地址表导致的。要解决此错误,请确认您的网络配置满足 AWS DMS 复制实例的连接要求

连接被拒调用错误

当来自 AWS DMS 复制实例的连接请求被 MongoDB 实例拒绝时,您会收到以下错误:

Test Endpoint failed: Application-Status: 1020912, Application-Message: Failed to create new client connection Failed to connect to database., Application-Detailed-Message: Error verifying connection: 'No suitable servers found (`serverSelectionTryOnce` set): [connection refused calling ismaster on 'mongodbtest.us-west-2.compute.amazonaws.com:27017']' Failed to connect to database.

当 MongoDB 数据库的 bindIp 设置不允许访问来自复制实例的连接时,就会出现此错误。要解决此错误,请将 MongoDB 实例上的 bindIp 配置修改为允许来自复制实例的连接。有关更多信息,请参阅有关 IP 绑定的 MongoDB 文档。

身份验证失败错误

当提供的凭证不正确或使用特殊字符时,您会收到以下错误:

Test Endpoint failed: Application-Status: 1020912, Application-Message: Failed to create new client connection Failed to connect to database., Application-Detailed-Message: Error verifying connection: 'Authentication failed.' Failed to connect to database.<br>

当终端节点中提供的用户名或密码不正确、为用户名字段提供的身份验证源数据库不正确,或者在密码中使用了 MongoDB 不接受的特殊字符时,就会出现这个错误。有关更多信息,请参阅创建源终端节点和目标终端节点

要解决这个错误,请通过使用终端节点中提供的用户名和密码连接到 MongoDB 数据库,确认您拥有正确的身份验证凭证。

Libmongoc 版本错误

当您使用 AWS DMS 复制实例不支持的 MongoDB 版本时,您会收到以下错误:

Test Endpoint failed: Application-Status: 1020912, Application-Message: Failed to create new client connection Failed to connect to database., Application-Detailed-Message: Error verifying connection: 'Server at ec2-35-166-73-109.us-west-2.compute.amazonaws.com:27017 reports wire version 2, but this version of libmongoc requires at least 3 (MongoDB 3.0)' Failed to connect to database.

要解决此错误,请将源 MongoDB 数据库升级到 AWS DMS 支持的 MongoDB 版本


相关信息

将 MongoDB 作为 AWS DMS 源

如何排查 AWS DMS 终端节点连接故障?

AWS 官方
AWS 官方已更新 2 年前