So, I follow the MongoDB Pluralsight tutorial, and I managed to create a, b and c database on the same machine. After successfully creating all three, I run mongo on port 30000, which is the port for my main database.
>mongo --port 30000
He displayed a connection to the port, and then I dialed
db.getMongo ()
He made a connection to the address
And I typed a javascript object as did the guy on Pluralsight that goes
>var democonfig={ _id: "demo", members: [{ _id: 0, host: 'localhost: 30000', priority: 10}, { _id: 1, host: 'localhost: 40000'}, { _id: 2, host: 'localhost: 50000', arbiterOnly: true}] };
After I hit enter, I tried to run rs.initiate with the democonfig file
rs.initiate(democonfig)
This is the error I get:
{ "ok" : 0, "errmsg" : "Bad digit \" \" while parsing 30000", "code" : 93 }
This is what my replicaSet bat file looks like.
cd \Pluralsight\
md \Pluralsight\db1
md \Pluralsight\db2
md \Pluralsight\db3
@REM Primary
start "a" c:\MongoDB\bin\mongod.exe
@REM Secondary
start "b" c:\MongoDB\bin\mongod.exe
@REM Arbiter
start "c" c:\MongoDB\bin\mongod.exe