windows 平台 mongo 主从配置

时间:2022-09-15 10:57:18
sc create MongoDB binPath= "\"I:\mongodb\mongodb-win32-x86_64-3.0.6\bin\mongod.exe\" --service --config=\"D:\Mongodb\mongo.cfg\"" DisplayName= "MongoDB" start= "auto"




sc create MongodbSlave binPath= "\"I:\mongodb\mongodb-win32-x86_64-3.0.6\bin\mongod.exe\" --service --config=\"D:\MongodbSlave\mongo.cfg\"" DisplayName= "MongodbSlave" start= "auto"




mongod.exe --master --port=27017 --dbpath="D:\Mongodb\data" --nohttpinterface


mongod.exe --slave --source-127.0.0.1 --port-27015 --dbpath-"D:\MongodbSlave\data" --slavedelay 5 --nohttpinterface