【问题标题】:Installed mongodb on AWS EC2 instance but unable to connect to it在 AWS EC2 实例上安装了 mongodb 但无法连接到它
【发布时间】:2014-08-09 15:29:52
【问题描述】:

我已经在 EC2 Amazon Linux 实例上安装了 MongoDB。我已经以打开端口 SSH 22 和 TCP 27017 的方式设置了安全组。不幸的是,当我尝试连接时,从 ssh 控制台执行命令

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

我收到以下错误

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

【问题讨论】:

  • 看起来类似的问题在这里得到了回答link
  • 我已通过将 bind_ip 字段修改为 0.0.0.0 解决了该问题。

标签: mongodb amazon-web-services ssh amazon-ec2


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 2016-09-22
    • 2018-12-12
    • 1970-01-01
    • 2017-03-14
    • 2018-01-03
    • 2016-08-24
    • 1970-01-01
    • 1970-01-01
    • 2016-08-20
    相关资源
    最近更新 更多