简体   繁体   中英

MongoDB Replica Set and URL server ordering

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?

发现还有另一段代码导致了此问题。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM