I am somewhat new to MongoDB and this might be a silly thing to ask but I'm trying to set up a sharded cluster. I have two mongods running on two different machines, say A and B, on ports 10000 and 20000 respectively.
On machine A itself, I have configured the mongos as well (on port 27019) and added the above two shards on it..My chunks collection is also sharded with proper key. I know how to access the database from mongos shell..But I have an ASP.NET application that I want to connect to mongos..
Before sharding, when I was having just one database on default port on one machine, I was using this connection string in the application:
string connectionString = "mongodb://localhost:27017";
Now I want to connect to "mongos"..something like:
string connectionString = "mongos://localhost:27019";
I tried : "mongodb://localhost:27019"
; But it didn't work which is actually fine because I 'know' there's no mongod there!
How should I do this? Or am I missing a core concept here?
Thanks in advance :)
Regards