Start MongoDB Service

  1. Press Windows+R, type services.msc and press Enter.
    Figure 1. MongoDB Installation - Enterprise Version (HA) (Cont.)
  2. 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.)
    A screenshot of a computer Description automatically generated
    Note:
    These above steps must be performed on all the servers that are part of the replica set.
  3. Go to all the servers that have MongoDB service installed.
  4. 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
  5. If the service is running successfully, then connection will be established without any error message.