Quantcast
Channel: StackExchange Replication Questions
Viewing all articles
Browse latest Browse all 17268

ReplicaSet MongoDB

$
0
0

I'am trying to create replcaSet in MongoDB and I'am facing a problem.

This is what I did step by step:

1- I entered this command to create these repertories:

mkdir \data\rs1 \data\rs2 \data\rs3 

2- I entered this:

start mongod --replSet amir --logpath \data\rs1\1.log --dbpath \data\rs1 --port 27017 --smallfiles --oplogSize 64

As a second cmd:

start mongod --replSet amir --logpath \data\rs1\2.log --dbpath \data\rs2 --port 27018 --smallfiles --oplogSize 64

Then as a third cmd:

start mongod --replSet amir --logpath \data\rs1\3.log --dbpath \data\rs3 --port 27019 --smallfiles --oplogSize 64

After that I entered this in the first cmd:

config={_id:"amir", members:[ {_id:0,host:"localhost:27017"},  {_id:1,host:"localhost:27018"}, 
{_id:2,host:"localhost:27019"}] };

And finnally I entered:

 rs.initiate (config); 

It showed me this :

  { "ok" : 0, "errmsg" : "Missing expected field \"version\"", "code" : 93 }

Do you have any ideas on this problem?

enter image description here


Viewing all articles
Browse latest Browse all 17268

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>