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