I want to use MongoDB River for ElasticSearch, but for this purpose I need to convert my standalone to replica set.
I followed the official documentation but, I encounter this message when going through Step 2:
replSet can't get local.system.replset config from self or any seed (EMPTYCONFIG)
Some references say I need to run rs.initiate()
, but how can I do this while the Mongo server is shutdown?
take a break and read the documentation with calm :) they don't say to just shut down the server, they say to shut down your actual mongo istance (because that one is been started as a standalone instance), and right after to start again that instance with a different string, they give that in example:
mongod --port 27017 --dbpath /srv/mongodb/db0 --replSet rs0
where --dbpath point to the path of your datafiles. rs0 is the name of the replicaset, choose your one or just use this
then you can run rs.initiate()
BUT: if you already made some try, and you runned an rs.initiate() without succed, you have to do something before repeat all the procedure:
mongo --port 27017
show dbs
use local
db.dropDatabase()
then you can repeat all the procedure and try to properly set up your replicaset.