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
demandé il y a un an634 vues
1 réponse
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
répondu il y a un an

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions