1
votes

If I connect from localhost, then everything is fine, if I connect from ec2 aws - error "[Error: No valid replicaset instance servers found]"

code is the same, on localhost and on ec2 ubuntu

mongoose.connect('mongodb://:@cluster0-shard-00-00-llnwa.mongodb.net:27017,cluster0-shard-00-01-llnwa.mongodb.net:27017,cluster0-shard-00-02-llnwa.mongodb.net:27017/test?ssl=true&replicaSet=Cluster0-shard-0&authSource=admin');

1

1 Answers

0
votes

Have you tried enabling the port 27017 in the security groups on ec2

enter image description here