sharding: clusterRole: shardsvr 

Or, if using the older configuration file format$^{50}$: 

shardsvr = true 

Finally, to establish the cluster, configure at least one mongos process with the following settings: 

In YAML format : 

sharding: configDB: 10.8.0.12:27001 chunkSize: 64 

Or, if using the older configuration file format$^{51}$: 

configdb = 10.8.0.12:27001 chunkSize = 64 

Important: Always use 3 config servers in production environments. 

You can specify multiple configDB instances by specifying hostnames and ports in the form of a comma separated list. 

In general, avoid modifying the chunkSize from the default value of 64, 52 and ensure this setting is consistent among all mongos instances. 

## See also: 

The Sharding (page 661) section of the manual for more information on sharding and cluster configuration. 

## Run Multiple Database Instances on the Same System 

In many cases running multiple instances of mongod on a single system is not recommended. On some types of deployments 53 and for testing purposes you may need to run more than one mongod on a single system. 

In these cases, use a base configuration (page 193) for each instance, but consider the following configuration values: 

In YAML format : 

storage: dbPath: /srv/mongodb/db0/ processManagement: pidFilePath: /srv/mongodb/db0.pid 

Or, if using the older configuration file format$^{54}$: 

dbpath = /srv/mongodb/db0/ pidfilepath = /srv/mongodb/db0.pid 

The dbPath value controls the location of the mongod instance’s data directory. Ensure that each database has a distinct and well labeled data directory. The pidFilePath controls where mongod process places it’s process id 

