Accessing Mongos with Compass

I am working on the “Shard A Collection” Lab and I found that I am not sure how to connect to it using compass now that it has been sharded. I attached a screenshot of my current connection settings and the resulting window I get. I am attempting to connect to 26000 but I have also attempted 27001 which only shows the built in dbs, not the m103 db which was created using the provided import command on 26000.

My Connection Settings:

The result:

I am fairly certain on what the correct key would be here, but I like the Compass application and being able to get more familiar with it, when possible.

Thanks in advance for any help!

Hi Christopher_79126,

I would check my sh.status() from mongos. And look for where the sharded data is located. For example, when I did sh.status(), here is where I found my data was located. And then obviously, you will look for chunks for how much data is there on which shard.

And also don’t forget to mention your replica set name correctly. Here is my configuration which worked for me:

Let me know if I can help more.


1 Like

Thank you, I think you got me on the right track! To anyone else who comes across this, the necessary info did come from doing an sh.status() and finding the location of the db that was created.

Here is mine, the issue was I had only attempted to connect to the first shard and mongos, when the mongos had created the db on the second shard. I was able to find the location of the db with the below sh.status()

Thanks again for the help @Kanika!

1 Like

Anytime @Christopher_79126! Good luck!