0

I am using nodejs and I have a connection URL:

config.mongodb.url = 'mongodb://test-mongodb-2,test-mongodb-1,test-mongodb-3:27017/test_db?replicaSet=test_rs';

If test-mongodb-2 is not the primary, the connection fails with:

not master and slaveOk=false

I am using the latest version of the driver: 2.1.21

Is there an option that I am missing?

Vince Bowdren
  • 8,326
  • 3
  • 31
  • 56
Rob
  • 187
  • 1
  • 7
  • Have you double-checked the health of the replicaset (`rs.status()`), and the connectivity between your client and each node of the replicaset? – Vince Bowdren Oct 05 '16 at 09:58
  • Yep, everything works fine as long as the primary is listed first in the URL. – Rob Oct 05 '16 at 11:17

1 Answers1

0

Found that there was another piece of code that was causing the problem.

Rob
  • 187
  • 1
  • 7