Start MongoDB Service
- Press Windows+R, type services.msc and press Enter.
Figure 1. MongoDB Installation - Enterprise Version (HA) (Cont.)
- Search for MongoDB service, then click on it and click Start the service on
the Left pane.
Figure 2. MongoDB Installation - Enterprise Version (HA) (Cont.)
Note:These above steps must be performed on all the servers that are part of the replica set. - Go to all the servers that have MongoDB service installed.
- Open the Command Prompt as Administrator and execute the below command by
changing respective IP and port of server.Note:Ensure that the port on which MongoDB service is running is open for communication.
mongosh --host <IP> --port <port on which mongoDB service is running (mentioned in config file)> for e.g. server1: mongosh --host x.x.x.x1 --port 27014 server2: mongosh --host x.x.x.x2 --port 27015 server3: mongosh --host x.x.x.x3 --port 27016 - If the service is running successfully, then connection will be established without any error message.