错误信息 | 报错原因及解决方法 |
network error while attempting to run command 'isMaster' on host 'dds-xxxx.mongodb.rds.aliyuncs.com:3717' :exception: connect failed
| |
Timed out after 3000ms while waiting for a server that matches ReadPreferenceServerSelector{readPreference=primary}. exception=(com.mongodb.MongoSocketReadException: Prematurely reached end of stream)
Socket recv() errno:54 Connection reset by peer x.x.x.x:27017
| 可能该实例的连接数已经达到上限,无法为新的连接请求建立连接。 解决方法: 检查连接数是否耗尽:如何查询连接数?。 优化连接使用:如何解决实例连接数满的问题?。
|
MongoDB.Driver.MongoWaitQueueFullException: The wait queue for acquiring a connection to server xxx is full.
| MongoDB 驱动程序的等待队列已满,可能由于连接池设置较小或出现高并发请求等原因导致,从而无法提供可用连接。 解决方法: 建议您优先检查对应报错程序的连接池配置,例如确保设置了合理的连接池大小,详情请参见如何限制终端连接数?。 若程序侧调整后问题依然存在,您可检查MongoDB实例侧的连接数是否耗尽,请参见: 如何查询连接数? 如何解决实例连接数满的问题?
|
(TooManyLogicalSessions) Unable to add session into the cache because the number of active sessions is too high.
| 并发连接过多时,可能会耗尽可用会话。 解决方法: 排查因连接数耗尽导致连接失败的问题。 如何查询连接数? 如何解决实例连接数满的问题?
如果连接数未发现异常,排查实例其他性能是否无法满足业务需求。 通过节点监控查看常用资源(例如CPU使用率和内存使用率)的运行情况,确认实例规格大小是否满足业务需求。 如果实例规格过小,但负载较高,可在业务低峰期变更实例配置。
|
| 请检查实例连接地址是否正确,连接地址说明,请参见: |
Failed to connect to 10.*.*.8:3717 after 5000 milliseconds, giving up.Error: couldn't connect to server 10.*.*.8:3717 (10.*.*.8), connection attempt failed
pymongo.errors.ServerSelectionTimeoutError: dds-xxxx.mongodb.rds.aliyuncs.com:3717: [Errno 113] No route to host,dds-xxxx.mongodb.rds.aliyuncs.com:3717
InvalidInstanceId.NotFound: The instance not in current vpc.
| 云服务器ECS实例通过私网连接云数据库MongoDB失败。 解决方法: 检查白名单设置。确保云服务器ECS实例的私网IP地址添加到云数据库MongoDB实例的白名单。 确保ECS实例与MongoDB实例网络互通。 ECS与MongoDB实例在同一个专有网络中(VPC ID相同),可直接通过私网连接。跨VPC时,可参考以下方式调整。
|
org.springframework.data.mongodb.UncategorizedMongoDbException: Timeout while receiving message; nested exception is com.mongodb.MongoSocketReadTimeoutException: Timeout while receiving message
| |
"errmsg": "not master", "code": 10107, "codeName": "NotMaster"
"errmsg": "not master", "code": 10107, "codeName": "NotWritablePrimary"
Time out after 30000ms while waiting for a server that matches writableServerSelector.
Command failed with error 10107 (NotWritablePrimary): 'not primary' on server xxx .
Explain's child command cannot run on this node. Are you explaining a write command on a secondary?
not master and slaveOk=false.
MongoNotPrimaryException: Command failed with error 10107 (NotMaster): 'not master' on server xxx.
reason: TopologyDescription { type: 'ReplicaSetNoPrimary',...}
| 当前写入数据的节点不是主节点(Primary节点)。 原因:仅主节点可以执行写操作。如果您的业务之前通过主节点(Primary节点)的地址连接,副本集实例主备切换后,实际连接的节点角色变成了从节点(Secondary节点),写入会失败。 解决方法: 请为业务设计重连机制和异常处理能力,连接闪断后可自动重连,保障业务稳定运行。 |
[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不支持replSetGetConfig 命令。更多信息,请参见云数据库MongoDB版支持及限制哪些命令? |