- 新しい順
- 投票が多い順
- コメントが多い順
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 ?
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.
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...
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 ;)
関連するコンテンツ
- AWS公式更新しました 8ヶ月前