Hi @Anusha_Reddy and welcome in the MongoBD Community
!
I think you have a port issue here.
Inside your containers, mongod runs on port 27017 and you are mapping these ports on your host to 27012, 27013 and 27014 which is fine because you can’t have 3 services running on the same port.
So you can’t expose 27017 for each containers.
When you connect to this cluster, you should use the exposed ports so 27012, 27013 and 27014 with the IP address of your host.
I’m already surprised your host can resolve “mongo1”.
From your host, you should use rs0/127.0.0.1:27012,127.0.0.1:27013,127.0.0.1:27014 I think.
I hope this helps.
Cheers,
Maxime.
1 Like