我发现无法访问AWS EC2 Ubuntu中托管的MongoDB的问题。
我做到了
#network interfaces
net:
port: 27017
#bindIp: 127.0.0.1
security:
authorization: 'enabled'
,重新启动MongoDb并打开
Netword & Security -> Security Groups -> Inbound tab -> Edit button.
Make a new Custom TCP on port 27017, Source: Anywhere, 0.0.0.0/0
安全组的。但是,当我尝试像mongo -u user -p mypassword 52.221.226.195/mydb
这样访问时,发现以下错误表明该连接被拒绝。请帮我解决问题。
2019-04-17T15:57:58.321+0630 E QUERY [js] Error: couldn't connect to server xx.xxx.xxx.xxx:27017, connection attempt failed: SocketException: Error connecting to xx.xxx.xxx.xxx:27017 :: caused by :: Connection refused :
connect@src/mongo/shell/mongo.js:257:13
@(connect):1:6
exception: connect failed