Errors

Errors similar to the following may be returned when you try to establish a connection by using the mongo shell:

    2015-12-21T10:20:36.084+0800 I NETWORK  Socket recv() errno:54 Connection reset by peer  1.2.3.4:27017
    2015-12-21T10:20:36.087+0800 I NETWORK  SocketException: remote: 1.2.3.4:27017 error: 9001 socket exception [RECV_ERROR] server [1.2.3.4:27017]
    2015-12-21T10:20:36.087+0800 I NETWORK  DBClientCursor::init call() failed

Possible causes

The ApsaraDB for MongoDB instance rejects the connection request of your application because its connections are at the upper limit and cannot connect your application.

Solutions

  1. Restart the ApsaraDB for MongoDB instance to release all connections.
  2. Connect to a replica set instance by using the mongo shell.
  3. Analyze the source IP addresses of connections and limit the number of connections from a client. For more information, see How to query and limit the number of connections.
    Note If the source IP addresses are normal, perhaps your current ApsaraDB for MongoDB instance is unqualified for your business needs. You can upgrade the instance to increase the upper limit of connections allowed. For more information, see Configuration change overview.