add database repl-set scripts

master
Kevin Lynx 11 years ago
parent 2d4d3f89a7
commit ea6df3b2df

@ -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

@ -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

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

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

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

@ -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);

@ -0,0 +1 @@
4C3B4CF8CC58F6755BBE3B6FB073145958A67B6E

@ -0,0 +1 @@
4C3B4CF8CC58F6755BBE3B6FB073145958A67B6E
Loading…
Cancel
Save