Mongodb version: v3.6.4
Server: Tengxun Cloud
Problem description: mongodb started on the server can be connected to, but when the link command takes non-localhost (or 127.0.0.1), the connection fails, and the Ip is neither the internal IP nor the public IP of the server.
MongoDB shell version v3.6.4 connecting to: mongodb://ip:53082/ 2018-06-07T07:28:14.837+0800 W NETWORK [thread1] Failed to connect to ip:53082, in(checking socket for error after poll), reason: Connection refused 2018-06-07T07:28:14.837+0800 E QUERY [thread1] Error: couldn't connect to server ip:53082, connection attempt failed : connect@src/mongo/shell/mongo.js:251:13 @(connect):1:6 exception: connect failed
How to solve the problem?
Later, the problem was solved through other channels.
By adding bind_ip=0.0.0.0 to the setup file and restarting mongodb, the problem is solved