MongoDB Documentation, Release 3.0.4 Add a Shard to a Cluster Deploy Three Config Servers for Production Deployments Tip You interact with a sharded cluster by connecting to a mongos instance. mongo --host mongos0.example.net --port 27017 You can instead use the addShard database command, which lets you specify a name and maximum size for the shard. If you do not specify these, MongoDB automatically assigns a name and maximum size. To use the database command, see addShard . Optional sh.addShard( • To add a shard for a standalone mongod on port 27017 of mongodb0.example.net , issue the fol- lowing command: For MongoDB versions prior to 2.0.3, you must specify all members of the replica set. For example: Changed in version 2.0.3. sh.addShard( "rs1/mongodb0.example.net:27017" ) • To add a shard for a replica set named rs1 with a member running on port 27017 on mongodb0.example.net , issue the following command: The following are examples of adding a shard with sh.addShard() : sh.addShard( "mongodb0.example.net:27017" ) Note: It might take some time for chunks to migrate to the new shard. This procedure converts a test deployment with only one config server (page 670) to a production deployment with three config servers. Use CNAMEs to identify your config servers to the cluster so that you can rename and renumber your config servers without downtime. For redundancy, all production sharded clusters (page 661) should deploy three config servers on three different machines. Use a single config server only for testing deployments, never for production deployments. When you shift to production, upgrade immediately to three config servers. To convert a test deployment with one config server to a production deployment with three config servers: 1. Shut down all existing MongoDB processes in the cluster. This includes: Chapter 10. Sharding 698 2. Add a shard to the cluster using the sh.addShard() method, as shown in the examples below. Issue sh.addShard() separately for each shard. If the shard is a replica set, specify the name of the replica set and specify a member of the set. In production deployments, all shards should be replica sets. 1. From a mongo shell, connect to the mongos instance. For example, if a mongos is accessible at mongos0.example.net on port 27017 , issue the following command: