Hello Everyone,
I have a concern or doubt, I have a replica set configuration (PSSH) in my environment as below.
Production Replica Set
- Node1 - (Primary)
- Node2 - (Secondary)
- Node3 - (Secondary)
- Node4 - (Secondary-Hidden) - ( Only for developers to run some find operation, which will not impact the production (PSS) load )
Now we want to convert our replica-set to sharded cluster, I am proposing the below structure for sharded cluster.
Production Sharded Cluster :
Config Server :
- prod-config01 (Primary)
- prod-config02 (Secondary)
- prod-config03 (Secondary)
MongoS Server :
- prod-mongos01
- prod-mongos02
- prod-mongos03
Shard1 Server : shard01repl
- prod-mongo-shard01repl01 (Primary)
- prod-mongo-shard01repl02 (Secondary)
- prod-mongo-shard01repl03 (Secondary)
- prod-mongo-shard01repl04 (Secondary-hidden)
Shard2 Server : shard02repl
- prod-mongo-shard02repl01 (Primary)
- prod-mongo-shard02repl02 (Secondary)
- prod-mongo-shard02repl03 (Secondary)
- prod-mongo-shard02repl04 (Secondary-hidden)
Question 1 : We have a user named aditya.sharma with some secret password. This user have tool like mongo shell or robo3t or compass to connect to the database. How this aditya.sharma user will connect to mongodb sharded cluster via mongos to run below query on Secondary-Hidden node only?
use test
db.testColl.find({ name : “Aditya Kumar Sharma” })
Note : Sharding is already enabled on test database and the testColl collection is also sharded using _id field as shard key and the data is also distributed on both the shards evenly.
Please help me to understand, if anyone have any Idea.
Thank you so much in advance.
Regards,
Aditya Sharma