Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"errmsg" : "server is not running with --replSet"

Tags:

mongodb

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

like image 498
Sandeep.maurya Avatar asked Jul 03 '14 15:07

Sandeep.maurya


1 Answers

I had the same problem. Thanks to this question and previous answers I solved doing:

  • I checked all the running mongod processes ps -ef | grep mongo. I had 1 mongo and 2 mongod processes
  • I killed mongod with sudo sudo killall mongod
  • and at the end I started with sudo sudo mongod --port 27017 --dbpath \srv\mongodb\rs0-0 --replSet rs0 --smallfiles --oplogSize and it worked
like image 67
enri Avatar answered Oct 28 '22 04:10

enri