error-could-not-connect-to-any-servers-in-your-mongodb-atlas-cluster

0

Hi AWS, I know this might not be a right question for the community here but the point is my VPC is having IPv4 CIDR block of 172.31.0.0/16 and the Atlas VPC CIDR block is 10.8.0.0/21. The peering connection is available and I have even allow access from anywhere in MongoDB Atlas UI for the cluster but still experiencing the same issue. EC2 instance is the VPC with a public subnet.

I have tried every way possible but still same issue persists. Please help.

profile picture
已提問 1 年前檢視次數 634 次
1 個回答
0

Hi Arjun,

A few components that can potentially affect access here. Feel free to add additional details if needed.

Assuming that the peering connection is up/active, you would still need to route the CIDR blocks statically to reach hosts in the peered VPCs. You mentioned that you allowed access in MongoDB, but you also need to make sure you have the appropriate access in your Security Groups and VPC NACLs.

Example VPC Routing

Also, if these hosts are referencing each other via DNS hostnames, you may need to enable DNS hostnames in the associated VPCs.

From the public documentation regarding DNS: "With the default VPC peering connection options, if EC2 instances on either side of a VPC peering connection address each other using a public DNS hostname, the hostname resolves to the public IP address of the instance. To change this behavior, enable DNS hostname resolution for your VPC connection. After enabling DNS hostname resolution, if instances on either side of the VPC peering connection address each other using a public DNS hostname, the hostname resolves to the private IP address of the instance."

Hope this helps, if not, please post some additional details

Thanks!

AWS
已回答 1 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南