Database Reference
In-Depth Information
among shards. Rather than use a separate application like ZooKeeper,
MongoDB uses specially configured MongoDB databases to act as
configuration managers. This is activated by adding --configsvr to
mongod 's command-line arguments:
$ mkdir configdb
$ ./mongod --configsvr --dbpath ./configdb
...
[initandlisten] command local.$cmd command: {
create: "startup_log",
size: 10485760,
capped: true
} ntoreturn:1 keyUpdates:0 reslen:37 168ms
[initandlisten] ******
[initandlisten] creating replication oplog of size:
5MB...
[initandlisten] ******
[websvr] admin web console waiting for connections on
port 28019
[initandlisten] waiting for connections on port 27019
Notice that the configuration server starts itself on a different port than
the normal MongoDB server. This makes it possible to run a normal shard
server and a configuration server on the same machine if desired. These
servers are lightly loaded, so having them share resources with another
server is usually not a problem.
If attempting to run a sharded server on a development machine, now is
the time to stop any running mongod processes. The mongos server runs on
the same port as mongod and, because clients will be attaching to mongos ,
it is usually easier to change the mongod port(s). To test mongos on a
single-machine, after starting the configuration server, start the mongod
server on a different port:
$ ./mongod --dbpath ./db/ --port 27018
[initandlisten] MongoDB starting : pid=9653
port=27018 dbpath=./db/
64-bit
[initandlisten]
Search WWH ::




Custom Search