I installed:
MongoDB
v7.0.5 as a service on the Windows Server 2019.Mongosh
v2.1.5 on the Windows 10But when trying to connect the MongoDB server on the Windows Server 2019 from the Windows 10 I receive the following error:
MongoNetworkError: connect ECONNREFUSED 172.18.44.22:27017
I checked:
27017
(in/out)I checked a lot of posts on StackOverflow: most of these related to Linux, the rest are describing solutions that don't help.
What might be problem?
When I launch mongosh
locally on the Windows Server 2019 it is running without a problem.
Thanks
Double click on the service and have a look at "Path to Executable", should be something like C:\Program Files\MongoDB\mongod.exe --config ...
Have a look at the config file, most likely it contains these lines:
net:
port: 27017
bindIp: localhost
Which means, the MongoDB listens to localhost
and you can connect only from your local machine. To enable connections from other computers change it to
net:
port: 27017
bindIpAll: true
and restart the service.