FS1360472174 / nosql-mongo

mongo knowledge
4 stars 4 forks source link

mongo connections string bug #24

Open FS1360472174 opened 7 years ago

FS1360472174 commented 7 years ago

http://stackoverflow.com/questions/41307098/mongoerror-no-primary-found-in-replicaset-mongoose-replaces-external-ip-addres

http://mongodb.github.io/node-mongodb-native/2.2/reference/faq/

mongo nodejs driver 2.1.21 可以识别host和ip。 但是2.2.24 不识别ip.(如果只配置了host)

只认rs.status() 中members 中配置的host

可以动态更改

cfg = rs.conf()
cfg.members[0].host = "xxx"
rs.reconfig(cfg)