#StackBounty: #mongodb #database-replication #replicaset How to setup primary DB for replica Mongo DB

Bounty: 50

I am trying run a nodejs application. In order to do that I need to setup replica mongodb. I couldn’t understand what should I do where. I need step by step explanation like my IQ is around room tempratures.

So this is the ENV variable for DB

MAIN_DATABASE=mongodb://127.0.0.1:27017,localhost:27018/maindb?replicaSet=rs0

I am running this command and starting a replica mongodb

mongod --port 27021 --dbpath "/data" --replSet rs0

And this is the error message that I get

-> no primary found in replicaset or invalid replica set name

I have ip’s of 2 mongo db’s running

62.210.**.**  mongo1
212.129.**.** mongo2


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.