mongodb只能通过localhost连接

时间:2018-06-07 00:24:12

标签: mongodb database-connection

操作系统:Centos 7 mongodb:v3.6.4 问题:只能通过localhost或127.0.0.1连接,如果添加--host hostIp(如192.168.1.1),将是连接拒绝。 错误代码:

MongoDB shell version v3.6.4
connecting to: mongodb://IP:53082/
2018-06-07T07:57:46.310+0800 W NETWORK  [thread1] Failed to connect to IP:53082, in(checking socket for error after poll), reason: Connection refused
2018-06-07T07:57:46.311+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

那么,如何解决这个错误?请

0 个答案:

没有答案