简体   繁体   English

在AWS EC2实例上安装了mongodb,但无法连接到该实例

[英]Installed mongodb on AWS EC2 instance but unable to connect to it

I have installed MongoDB on EC2 Amazon Linux instance. 我已经在EC2 Amazon Linux实例上安装了MongoDB。 I have set the security group in the way the port SSH 22 and TCP 27017 are opened. 我以打开端口SSH 22和TCP 27017的方式设置了安全组。 Unfortunately when I try to connect executing the command from the ssh console 不幸的是,当我尝试连接从ssh控制台执行命令时

mongo <public-dns-name>:27107/test

I get the following error 我收到以下错误

connecting to: <public-dns-name>:27017/test
2014-08-09T15:25:07.966+0000 warning: Failed to connect to xxx.xx.xx.xx:27017, reason: errno:111 Connection refused
2014-08-09T15:25:07.967+0000 Error: couldn't connect to server <public-dns-name>:27017 (172.31.19.26), connection attempt failed at src/mongo/shell/mongo.js:148
exception: connect failed

您可能需要使用nginx的流模块,因为默认情况下,nginx设置为http。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM