I’ve setup MongoDB replica set on a single machine with 3 different port 27017, 27018, and 27019.
MongoDB connection works fine When I’m connecting from the same machine with the private IP(IPV4).
But, I’m getting an error when I’m trying to access the replica set remotely.
I’m getting below error when I’m trying to connect from the robo3t.
Cannot connect to replica set “Mongo Server”[IP_ADDRESS:27017].
Set’s primary is unreachable.
No member of the set is reachable. Reason: Connect failed
I’ve tried with the robo3t and programming with below connection string.
Note: I can able to connect the standalone MongoDB with the public IP.
Thanks in advance.