add database repl-set scripts

This commit is contained in:
Kevin Lynx 2013-07-02 17:42:35 +08:00
parent 2d4d3f89a7
commit ea6df3b2df
8 changed files with 26 additions and 0 deletions

View File

@ -13,4 +13,7 @@ copy tools\*.* bin\
mkdir bin\priv
mkdir bin\ebin
copy ebin\*.* bin\ebin\
mkdir bin\tools
mkdir bin\tools\db-replset
copy tools\db-replset\*.* bin\tools\db-replset\
pause

View File

@ -0,0 +1,10 @@
The scripts in this directory can help you to deply a repl set mongodb, which there is a primary database used by the crawler, and the secondary database is used to query by the http server.
[Check here if you know Chinese](http://www.cnblogs.com/dennisit/archive/2013/01/28/2880166.html)
Make sure mongod is in your path.
* db-start-primary.bat
* db-start-slave.bat
* init-primary-db.bat, make sure `rs.initiate()` success

View File

@ -0,0 +1 @@
mongod --replSet rs1 --keyFile key1.txt --port 27010 --dbpath db --setParameter textSearchEnabled=true --logappend --logpath db-primary.log --pologSize

View File

@ -0,0 +1,2 @@
mongod --replSet rs1 --keyFile key2.txt --port 27017 --dbpath dbread --setParameter textSearchEnabled=true --logappend --logpath db-slave.log --pologSize

View File

@ -0,0 +1,2 @@
mongo --port 27010 init-rs.js
pause

View File

@ -0,0 +1,6 @@
config_rs1 = {
_id : "rs1",
members : [ { _id:0, host:"localhost:27010", priority:1 }, { _id:1, host:"localhost:27017" } ]
};
rs.initiate(config_rs1);

View File

@ -0,0 +1 @@
4C3B4CF8CC58F6755BBE3B6FB073145958A67B6E

View File

@ -0,0 +1 @@
4C3B4CF8CC58F6755BBE3B6FB073145958A67B6E