Using the c# driver and MongoDB on windows server. Connection code looks like this:
using (var mongo = new Mongo(ConnectionString))
{
mongo.Connect();
//do stuff
mongo.Disconnect();
}
if ConnectionString == "mongodb://LocalHost/MyCollection"
everything is fine if ConnectionString == anything else... doesn't work... even if I use my local IP
IE:
mongodb://192.168.0.55/MyCollection
Fails with the error:
"No connection could be made because the target machine actively refused it 192.168.0.55:27017"
Mongo IS running, I can connect on the other machine locally..
I'm at a loss for how to diagnose/fix this issue, a开发者_运维问答ny suggestions?
Is Windows Firewall blocking access?
You must add a rule with the specified port (27017 is the default) in the Windows Firewall and surely will works.
精彩评论