mongoose icon indicating copy to clipboard operation
mongoose copied to clipboard

mongoose : replica set , Error message ::: no primary found in replicaset or invalid replica set name

Open gom3441 opened this issue 8 years ago • 1 comments

mongoose version : 5.3.0

cont  mongoose = require('mongoose')

mongoose.connect('mongodb://localhost:27017,localhost:27017,localhost:27017/test?replicaSet=rsName', {useNewUrlParser:true, });

error message : no primary found in replicaset or invalid replica set name

I want to duplicate. Yes I followed it correctly and I get an error. What is the problem?

gom3441 avatar Oct 01 '18 17:10 gom3441

Why do you have 'localhost:27017' repeated 3 times? You need 3 distinct host/port combinations. Also, can you connect with the mongodb shell?

vkarpov15 avatar Oct 07 '18 17:10 vkarpov15