Yann,
When you create a database (by creating the first collection in it) in a sharded cluster, the mongos will set a primary shard for the database. This is where all un-sharded collections for that database will be stored. As you don’t plan to shard any of your collections, all collections for each database will be stored on its primary shard.
You can see databases and their primary shards in the output of sh.status(), or by displaying the contents of the config.databases collection:
use config;
db.databases.find()
Primary shards are chosen for new databases on the basis of which shard has the most free space at the time the database is created. You can change the primary chunk of a database with the movePrimary command:
db.adminCommand({movePrimary:"salesDB", to:"shard0003"});
Tag aware sharding can only be used to control the location of ranges of documents within sharded collections, so using tags to migrate databases will not be an option until you fully implement sharding.
Regards,
III
--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
For other MongoDB technical support options, see: https://docs.mongodb.org/manual/support/
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user...@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/c364ec07-4e22-4648-b8ac-2493a8b6a4dd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.