Cannot deploy MongoDB replica set on windows?
mongodb, replication
Solution
run `rs.initiate()` in mongo console after adding/changing the value of `replSet` in config file.
Problem
I want to deploy a mongodb replica set with 1 primary and 2 secondaries from config file as following: the first config file for primary node ``` #primary node #=============== dbpath = C:\data\rs0\1 directoryperdb = true bind_ip = 192.168.2.104 port = 27017 logpath = C:\mongodb2.5.3\logs\primary.log logappend = true noauth = true replSet = rs0 rest = true ``` the second config file for secondary node ``` #secondary node #=============== dbpath = C:\data\rs0\2 directoryperdb = true bind_ip = 192.168.2.104 port = 27018 logpath = C:\mongodb2.5.3\logs\secondary1.log logappend = true noauth = true replSet = rs0 rest = true ``` And the third config file for secondary node ``` #secondary node #=============== dbpath = C:\data\rs0\3 directoryperdb = true bind_ip = 192.168.2.104 port = 27019 logpath = C:\mongodb2.5.3\logs\secondary2.log logappend = true noauth = true replSet = rs0 rest = true ``` But i got this error ``` .... 2013-11-28T16:26:59.734+0700 [initandlisten] options: { bind_ip: "192.168.2.104", config: "config\mongorep.conf", dbpath: "C:\data\rs0\1", directoryperdb: true, logappend: true, logpath: "C:\mongodb2.5.3\logs\primary.log", noauth: true, port: 27017, replSet: "rs0", rest: true } 2013-11-28T16:26:59.742+0700 [FileAllocator] allocating new datafile C:\data\rs0\1\local\local.ns, filling with zeroes... 2013-11-28T16:26:59.742+0700 [FileAllocator] creating directory C:\data\rs0\1\local\_tmp 2013-11-28T16:26:59.835+0700 [FileAllocator] done allocating datafile C:\data\rs0\1\local\local.ns, size: 16MB, took 0.092 secs 2013-11-28T16:26:59.836+0700 [FileAllocator] allocating new datafile C:\data\rs0\1\local\local.0, filling with zeroes... 2013-11-28T16:27:00.101+0700 [FileAllocator] done allocating datafile C:\data\rs0\1\local\local.0, size: 64MB, took 0.265 secs 2013-11-28T16:27:00.102+0700 [initandlisten] command local.$cmd command: { create: "startup_log", size: 10485760, capped: true } ntoreturn:1 keyUpdates:0 reslen:37 360ms 2013-11-28T16:27:00.102+0700 [initandlisten] waiting for connections on port 27017 2013-11-28T16:27:00.103+0700 [rsStart] replSet can't get local.system.replset config from self or any seed (EMPTYCONFIG) 2013-11-28T16:27:00.103+0700 [rsStart] replSet info you may need to run replSetInitiate -- rs.initiate() in the shell -- if that is not already done 2013-11-28T16:27:00.104+0700 [websvr] admin web console waiting for connections on port 28017 2013-11-28T16:27:01.103+0700 [rsStart] replSet can't get local.system.replset config from self or any seed (EMPTYCONFIG) 2013-11-28T16:27:02.103+0700 [rsStart] replSet can't get local.system.replset config from self or any seed (EMPTYCONFIG) 2013-11-28T16:27:03.103+0700 [rsStart] replSet can't get local.system.replset config from self or any seed (EMPTYCONFIG) 2013-11-28T16:27:04.103+0700 [rsStart] replSet can't get local.system.replset config from self or any seed (EMPTYCONFIG) 2013-11-28T16:27:05.103+0700 [rsStart] replSet can't get local.system.replset config from self or any seed (EMPTYCONFIG) ``` And when i did exactly the same this guide http://docs.mongodb.org/manual/tutorial/deploy-replica-set-for-testing/ I also got the same error ``` replSet can't get local.system.replset config from self or any seed (EMPTYCONFIG) ``` I dont know what esle config i need to do to solve this problem, please help me, thanks a lot.