I am able to connect to connect to each of my 3 node replica set individually in direct connection mode using
mongosh "mongodb://user:pass@34.93.99.32:27017/dbname"
But when I try connecting to the replicaset with
mongosh "mongodb://<ip1>:27017,<ip2>:27017,<ip3>:27017/?replicaSet=rs0"
it fails with error
MongoServerSelectionError: Server selection timed out after 30000 ms
Since I’m able to connect to the individual nodes separately I’m assuming it’s not a network issue.
All 3 nodes are on GCP VMs. I’ve already configured the firewalls. All VMs have public IPs.