DocumentDB 4.0 vs mongo client

0

Hi all,

I launch a DocumentDB instance with 4.0 compatibility.

I try to connect from my EC2 Debian 10 with latest mongo client (mongodb 4.0 is not available for debian 10).

Connection seems ok but client is stuck after password. Not time out, connection is kept (seen in DocumentDB monitoring), but mongo shell is not available, unable to start mongo some query.

Does anyone succeed in accessing to DocumentDB from Debian 10 and mongo client ? (or using PHP since it will be my step after that).

demandé il y a 3 ans444 vues
4 réponses
0

Hi ,
I am able to connect to Amazon DocumentDB 4.0 from a Debain 10 EC2 instance and run queries in mongo shell. My Mongo shell version is 4.4.6. Do you see any error on the console ? Have you checked your security group configuration and ensured that security group assigned to DocumentDB has inbound rule that allows Debain 10 machine to communicate over port 27017 via TCP ? Which EC2 instance are you using ?

AWS
Karthik
répondu il y a 3 ans
0

Thank you for feedback, so it is possible to do it ;)

Extract of my session:

$ mongo --host .amazonaws.com:27017 --username USERNAME
MongoDB shell version v4.4.5
Enter password:
connecting to: mongodb://
*.amazonaws.com:27017/?compressors=disabled&gssapiServiceName=mongodb
(
with --verbose activated }
{"t":{"$date":"2021-05-11T21:14:23.579Z"},"s":"D1", "c":"NETWORK", "id":20109, "ctx":"js","msg":"Creating new connection","attr":{"hostAndPort":"
.amazonaws.com:27017"}}
{"t":{"$date":"2021-05-11T21:14:23.601Z"},"s":"D1", "c":"NETWORK", "id":20119, "ctx":"js","msg":"Connected to host","attr":{"connString":"
**.amazonaws.com:27017"}}

No error shown and moreover is says "connected". But shell prompt is not displayed. So for me network stuff are ok. Will try to update to 4.4.6 mongo client.

répondu il y a 3 ans
0

updated to mongo client 4.4.6, but same result.

"connected" message is not really "connected" because result is the same whatever password is given.

still searching...

répondu il y a 3 ans
0

It is ok now, just refollow:
https://docs.aws.amazon.com/documentdb/latest/developerguide/connect-ec2.html
and create a specific Security Group for DocumentDB instance with just 27017 allowed from EC2 security group.

I tryed to share same security group and it seems no to be a good idea.

I was mistaken also by DocumentDB monitoring that count connection but may be it was more and outbound issue with DocumentDB security group. Incoming where ok, so monitoring count it and mongo client stucks, but outgoing was not ok and mongo shell stucks.

Now going to php hoping it will work directly ;)

répondu il y a 3 ans

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