Database Reference
In-Depth Information
[mongosMain] starting next upgrade step from v0 to v4
[mongosMain] writing initial config version at v4
Mon Dec 2 20:07:18.120
[mongosMain] upgrade of config server to v4 successful
[Balancer] about to contact config servers and shards
[websvr] admin web console waiting for connections on
port 28017
[Balancer] config servers and shards contacted
successfully
[mongosMain] waiting for connections on port 27017
On production systems, there should be at least three configuration servers.
The mongos server is then provided with a comma-separated list of at
least some of those servers (more than one to provide failover). A single
configuration server should only be used for testing purposes.
Once the mongos server is running, the mongo client can be used to
configure the cluster itself. The sh.addShard function is used to add
shards to a cluster (this command is only available when attached to a
mongos server). If the server is a standalone server, only the hostname is
needed:
mongos> sh.addShard("localhost:27018")
{ "shardAdded" : "shard0000", "ok" : 1 }
To add a replica set, simply add one of the servers belonging to the replica
set (older versions of MongoDB might require that all servers be added as a
comma separated list):
mongos> sh.addShard("replset1/localhost:27018")
{ "shardAdded" : "shard0000", "ok" : 1 }
Finally, sharding is activated for a particular database:
mongos> sh.enableSharding("mine");
{ "ok" : 1 }
There are more fine-grained options for controlling the sharding of specific
collections within a database, but this is the basic use case. With sharding
Search WWH ::




Custom Search