i am creating replica set on my local system in windows environment by following step
mkdir -p \srv\mongodb\rs0-0 \srv\mongodb\rs0-1 \srv\mongodb\rs0-2
mongod --port 27017 --dbpath \srv\mongodb\rs0-0 --replSet rs0 --smallfiles --oplogSize 128
mongod --port 27018 --dbpath \srv\mongodb\rs0-1 --replSet rs0 --smallfiles --oplogSize 128
mongod --port 27019 --dbpath \srv\mongodb\rs0-2 --replSet rs0 --smallfiles --oplogSize 128
and then
mongo shell type mongo --port 27017
rs.initiate()
but i am getttin error
"{ "ok" : 0, "errmsg" : "server is not running with --replSet" }"
thanks in advance
I had the same problem. Thanks to this question and previous answers I solved doing:
ps -ef | grep mongo
. I had 1 mongo and 2 mongod processessudo killall mongod
sudo mongod --port 27017 --dbpath \srv\mongodb\rs0-0 --replSet rs0 --smallfiles --oplogSize
and it workedIf you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With