I am trying to do this:
mongod --replSet mySet --dbpath / data / r1 --port 27017 --oplogSize 700
mongod --replSet mySet --dbpath / data / r2 --port 27018 --oplogSize 700
mongod --replSet mySet --dbpath / data / r3 --port 27019 --oplogSize 700
then in the new terminal:
/mongo --port 27017 MongoDB shell version: 2.0.2 connecting to: 127.0.0.1:27017/test > cfg = { _id : "mySet", members : [ { _id : 0, host : "localhost:27017" }, { _id : 1, host : "localhost:27018" }, { _id : 2, host : "localhost:27019" } ] }
And when I run
rs.initiate (CFG)
I get this error:
{"errmsg": "server does not work with --replSet", "ok": 0}
Why am I getting this error?
from the log file:
Fri Jun 01 15:05:11 [initandlisten] MongoDB starting : pid=5236 port=27017 dbpath=c:\mongodb\data 64-bit host=mami Fri Jun 01 15:05:11 [initandlisten] db version v2.0.4, pdfile version 4.5 Fri Jun 01 15:05:11 [initandlisten] git version: 329f3c47fe8136c03392c8f0e548506cb21f8ebf Fri Jun 01 15:05:11 [initandlisten] build info: windows sys.getwindowsversion(major=6, minor=1, build=7601, platform=2, service_pack='Service Pack 1') BOOST_LIB_VERSION=1_42 Fri Jun 01 15:05:11 [initandlisten] options: { dbpath: "c:\mongodb\data", logappend: true, logpath: "c:\mongodb\logs\logfilename.log", service: true } Fri Jun 01 15:05:11 [initandlisten] journal dir=c:/mongodb/data/journal Fri Jun 01 15:05:11 [initandlisten] recover : no journal files present, no recovery needed Fri Jun 01 15:05:12 [initandlisten] waiting for connections on port 27017 Fri Jun 01 15:05:12 [websvr] admin web console waiting for connections on port 28017 Fri Jun 01 15:05:12 [initandlisten] connection accepted from 127.0.0.1:49663
I tried this replSet tutorial but still nothing
source share