MongoDB Documentation, Release 3.0.4 • all mongod instances or replica sets that provide your shards. 2. Copy the entire dbPath file system tree from the existing config server to the two machines that will provide the additional config servers. These commands, issued on the system with the existing Config Database (page 737), mongo-config0.example.net may resemble the following: • all mongos instances in your cluster. 3. Start all three config servers, using the same invocation that you used for the single config server. 4. Restart all shard mongod and mongos processes. 1. Create the initial three-member replica set and insert data into a collection. See Set Up Initial Replica Set (page 700). 2. Start the config databases and a mongos . See Deploy Config Databases and mongos (page 700). 3. Add the initial replica set as a shard. See Add Initial Replica Set as a Shard (page 701). 4. Create a second shard and add to the cluster. See Add Second Shard (page 701). 5. Shard the desired collection. See Shard a Collection (page 702). Prerequisites Considerations Convert a Replica Set to a Replicated Sharded Cluster Overview rsync -az /data/configdb mongo-config1.example.net:/data/configdb rsync -az /data/configdb mongo-config2.example.net:/data/configdb mongod --configsvr This tutorial converts a single three-member replica set to a sharded cluster with two shards. Each shard is an inde- pendent three-member replica set. The procedure is as follows: This tutorial uses a total of ten servers: one server for the mongos and three servers each for the first replica set , the second replica set, and the config servers (page 670). Each server must have a resolvable domain, hostname, or IP address within your system. The tutorial uses the default data directories (e.g. /data/db and /data/configdb ). Cre- ate the appropriate directories with appropriate permissions. To use different paths, see http://docs.mongodb.org/manual/reference/configuration-options . The tutorial uses the default ports (page 424) (e.g. 27017 and 27019 ). To use different ports, see http://docs.mongodb.org/manual/reference/configuration-options . In production deployments, use exactly three config servers. Each config server must be on a separate machine. In development and testing environments, you can deploy a cluster with a single config server. 699 10.3. Sharded Cluster Tutorials