需要创建一个EC2实例才能从Mongo Compass连接到文档数据库吗?

huangapple go评论56阅读模式
英文:

Is it mandatory to create a EC2 instance to connect document DB from Mongo compass?

问题

I have been trying to figure out what exactly is the issue connecting document DB cluster from mongo compass or studio 3T. I use following connection string but it doesn't work. Some says, we need to connect through EC2. But why on earth I have to create an EC2 instance to connect to document DB. I simply created a Document DB cluster thinking that it will work on its own.

这段文字是关于尝试连接文档数据库集群时遇到的问题,使用了连接字符串但无法连接,有人建议需要通过EC2连接,但为什么要创建EC2实例才能连接文档数据库呢?我只是简单地创建了一个文档数据库集群,认为它会自行工作。

英文:

I have been trying to figure out what exactly is the issue connecting document DB cluster from mongo compass or studio 3T. I use following connection string but it doesn't work. Some says, we need to connect through EC2. But why on earth I have to create an EC2 instance to connect to document DB. I simply created a Document DB cluster thinking that it will work on its own.

mongodb://username:password@host:port/database?tls=true&ssl_ca_certs=certfile&retryWrites=false

This is what is the security group inbound rules:
需要创建一个EC2实例才能从Mongo Compass连接到文档数据库吗?

答案1

得分: 3

请按照开发者指南中的链接1。尝试直接从公共端点连接到Amazon DocumentDB集群,例如您的笔记本电脑或本地开发机,将失败。Amazon DocumentDB仅支持虚拟专用云(VPC),目前不支持公共端点。因此,您无法直接从您的笔记本电脑或本地开发环境外部的VPC连接到Amazon DocumentDB集群。您需要设置一个EC2实例来进行代理/SSH隧道传输[2]。

1 https://docs.aws.amazon.com/documentdb/latest/developerguide/studio3t.html

[2] https://docs.aws.amazon.com/documentdb/latest/developerguide/connect-ec2.html

英文:

Please follow this link in the developer guide1. Trying to connect to an Amazon DocumentDB cluster directly from a public endpoint, such as your laptop or local development machine, will fail. Amazon DocumentDB is virtual private cloud (VPC)-only and does not currently support public endpoints. Thus, you can't connect directly to your Amazon DocumentDB cluster from your laptop or local development environment outside of your VPC. You have to setup an EC2 to proxy/ssh tunnel through[2].

1 https://docs.aws.amazon.com/documentdb/latest/developerguide/studio3t.html

[2] https://docs.aws.amazon.com/documentdb/latest/developerguide/connect-ec2.html

答案2

得分: 0

如果您按照以下 AWS 博客中的说明,您可以在本地环境中仅使用 VPN 连接到 DocumentDb,无需任何 EC2 实例。

链接:https://aws.amazon.com/blogs/database/securely-access-amazon-documentdb-with-mongodb-compatibility-locally-using-aws-client-vpn/

英文:

If you follow the below blog of aws you can connect DocumentDb from your Local environment using only VPN no need of any EC2 instance.

https://aws.amazon.com/blogs/database/securely-access-amazon-documentdb-with-mongodb-compatibility-locally-using-aws-client-vpn/

huangapple
  • 本文由 发表于 2023年5月26日 12:42:33
  • 转载请务必保留本文链接:https://go.coder-hub.com/76337727.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定