As an additional safeguard, just setting up the sharded cluster does not automatically start the sharding process. First, you need to enable sharding at the database level. Otherwise, just imagine the chaos that might occur! The primary command to enable sharding is sh.enableSharding(). The generic syntax is shown here. Obviously, you need to substitute the actual name of the database:
sh.enableSharding("DATABASE")
Continuing with our sharded cluster model, still connected to a mongos instance, we issue the appropriate command for the biglittle database, as shown here:
MongoDB elects a shard to serve as a primary, much as it does within members of a replica set. We use sh.status() to confirm that all three servers have been added to the sharded cluster, as shown here:
We are now ready to choose a shard key from the document fields of the target collection to be sharded.