0

I am working to deploy a replica set in three windows platform computers in the same network so I created the computer-name for each one like the following:

1.) DESKTOP-MONGO01:27017
2.) DESKTOP-MONGO02:27017
3.) DESKTOP-MONGO03:27017

I am trying to connect the second computer by using cmd

C:\DESKTOP-MONGO01>mongo "DESKTOP-MONGO02:27017"
MongoDB shell version v5.0.6
connecting to: mongodb://DESKTOP-MONGO02:27017/test?compressors=disabled&gssapiServiceName=mongodb
Error: couldn't connect to server DESKTOP-MONGO02:27017, connection attempt failed: NetworkTimeout: Error connecting to DESKTOP-MONGO02:27017 (10.25.35.96:27017) :: caused by :: Socket operation timed out :
connect@src/mongo/shell/mongo.js:372:17
@(connect):2:6
exception: connect failed
exiting with code 1

Network in Config file

net:
  port: 27017
  bindIp: 127.0.0.1,DESKTOP-MONGO02

All the three computers are use the same mongo version / same network but I am not able to connect the second or the third computer from the first one.

The issue is the mongo is able to see the computer Private IP (10.25.35.96) but cannot connect it for testing or for adding these nodes to the replica set, and if it is firewall issue in the second/third computer haw to solve it in windows firewall?

Thanks for helping

Mina Ezeet
  • 138
  • 7
  • Maybe use `bindIpAll: true` You can also try https://stackoverflow.com/questions/37839365/simple-http-tcp-health-check-for-mongodb/63790795#63790795 It could be the Windows Defender Firewall, did you check? Try `netstat -a` – Wernfried Domscheit Mar 23 '23 at 06:18
  • Maybe as a starting point, try to deploy all members on a single machine `localhost`, see https://github.com/Wernfried/mongoDB-oneclick as example – Wernfried Domscheit Mar 23 '23 at 06:27

1 Answers1

0

by whiting list port 27017 in all devices its working fine.

Mina Ezeet
  • 138
  • 7