mongodb-org-4.0.repo : No such file or directory al instalar el mongo shell en mi AWS Cloud9

168 views Asked by At

I try to connect to the mion cluster DocumentDB on AWS from AWS C9 with this tutorial. But every time I try to connect I get connection failed after 6 attempts:

(scr_env) me:~/environment/sephora $ mongo --ssl --host xxxxxxxxxxxxx:xxxxx --sslCAFile rds-combined-ca-bundle.pem --username username --password mypassword
MongoDB shell version v3.6.3
connecting to: mongodb://xxxxxxxxxxxxx:xxxxx/
2022-03-22T23:12:38.725+0000 W NETWORK  [thread1] Failed to connect to xxx.xx.xx.xxx:xxxxx after 5000ms milliseconds, giving up.
2022-03-22T23:12:38.726+0000 E QUERY    [thread1] Error: couldn't connect to server xxxxxxxxxxxxx:xxxxx, connection attempt failed :
connect@src/mongo/shell/mongo.js:251:13
@(connect):1:6
exception: connect failed

Indeed it seems to be missing the VPC configuration. So I tried to do with this documentation. But I do not know how to install the mongo shell on my AWS Cloud9. Indeed, it seems that I cannot create the repository file with the echo -e "[mongodb-org-4.0] \name=MongoDB repository baseurl=.... returns: mongodb-org-4.0.repo: No such file or directory.

Also, when I tried to install the mongo shell with sudo yum install -y mongodb-org-shell which I did not have, and which I installed, it returns repolist 0.

1

There are 1 answers

1
Nilton Moura On

I've never used DocumentDB on AWS, but what I answer here is a general solution to most of the failing connection issues:

The "fail to connect" error can be caused by a lot of reasons, but usually they are:

  • the service (mongo) might not be running on the destination server;
  • the service (mongo) might be listening on a different port number;
  • the service (mongo) might be protected by a firewall somewhere on the destination.

So you might want to ensure that:

  • mongo is running on the destination host;
  • mongo is listening on the defined port;
  • you're allowed to connect to the destination host on the defined port from the IP address or network range you're running the command to connect.