本文介绍连接云数据库MongoDB失败时的常见报错与解决方法。
错误信息 | 报错原因 | 解决方法 |
---|---|---|
|
实例连接数满,连接耗尽。 | 常见的解决方法请参见如下文档: |
Failed to connect to 10.*.*.8:3717 after 5000 milliseconds, giving up.Error: couldn't connect to server 10.*.*.8:3717 (10.1.2.8), connection attempt failed |
云服务器ECS实例通过私网连接云数据库MongoDB失败。 | 云服务器ECS实例和云数据库MongoDB实例需满足以下所有条件:
|
Error: network error while attempting to run command 'isMaster' on host 'ft12345678.mongodb.rds.aliyuncs.com:3717' |
白名单设置问题。 | 检查白名单设置,将正确的IP地址添加到云数据库MongoDB实例的白名单中,如何设置白名单,请参见设置白名单。 |
org.springframework.data.mongodb.UncategorizedMongoDbException: Timeout while receiving message; nested exception is com.mongodb.MongoSocketReadTimeoutException: Timeout while receiving message |
慢查询占用实例资源。 | 常见的解决方法请参见如下文档: |
|
当前写入数据的节点不是主节点(Primary节点)。 | 为什么副本集实例写入数据报错:NotMaster、NotWritablePrimary或Time out after 30000ms while waiting for a server that matches writableServerSelector? |
reason: TopologyDescription { type: 'ReplicaSetNoPrimary', |
当前连接的副本集实例中没有可用的主节点。 | 常见的解决方法如下: |
[Unauthorized] cloud instance error, disk locked, plz check and upgrade your disk quota, |
磁盘满导致实例锁定。 | 解决因磁盘空间耗尽导致的锁定或无法写入问题 |
(AuthenticationFailed) Authentication failed. |
|
常见原因及对应的解决方法如下:
|
|
数据库账号的密码中包含特殊字符!@#$%^&*()_+= 。 |
在连接串中对特殊字符进行转义处理,详情请参见如何解决连接串中账号密码包含特殊字符导致连接失败的问题。 |
error getting cluster ID: (CommandNotFound) replSetGetConfig is forbidden by cloud provider for security reason |
云数据库MongoDB不支持CommandNotFound 命令。 |
云数据库MongoDB版支持及限制哪些命令? |