When conducting lab - Shard a Collection in Ch.3 Sharding, I had been raised up a question.
I had imported data onto the primary shard by executing following command:
mongoimport --drop /dataset/products.json --port 26000 -u “m103-admin”
-p “m103-pass” --authenticationDatabase “admin”
–db m103 --collection products
And products were successfully imported into mongos and m103-repl-2 set.
To verify data only imported into m103-repl-2 set, I had executed following command:
mongo --host “m103-repl-2/192.168.103.100:27004” -u m103-admin -p m103-pass admin
m103 db was found
While executing following command:
mongo --host “m103-repl/192.168.103.100:27001” -u m103-admin -p m103-pass admin
Are there any mechanism that data firstly imported to m103-repl-2 instead of m103-repl? Or it’s just random? Or I have mis-understood something?