mongodb - 如何从我的笔记本电脑访问 AWS EC2 Ubuntu 中的 Mongodb
问题描述
我发现无法访问托管在 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
解决方案
推荐阅读
- mysql - 简化从 bash 脚本生成的 where 子句
- javascript - Javascript 菜单一次打开所有子菜单
- c# - 如果输入了无效数字,则显示错误消息
- python - C# Post 请求问题与 Python 的比较
- c# - UWP C# 应用程序无法打开通过 USB 连接的设备的驱动程序
- c++ - `auto *x = new some_struct{};` 是一个未初始化的变量吗?
- jmeter - JMeter 以 JTL 格式生成请求和响应数据
- python - 如何使用 Spotify API 使我的应用程序可供其他用户访问?
- graphql - 在 Graphql 操场上使用 AWS Cognito 用户池对 AppSync 突变进行身份验证
- c# - 试图根据生日和当前日期确定当前年龄