javascript - Mongo 2.6 isMaster() result after setting readPref to secondary -
we upgraded mongo 2.4 2.6 , have noticed our connection code staying primary host instead of connecting secondaries. despite following commands.
var connecthost = "rscomplex/complex0,complex1,complex2/data"; var maindb = connect(connecthost); maindb.getmongo().setreadpref("secondary"); maindb.ismaster() produces master { "setname" : "rscomplex", "setversion" : 77003, "ismaster" : true, "secondary" : false, "hosts" : [ "complex1:27017", "complex0:27017", "complex2:27017" ], "primary" : "complex1:27017", "me" : "complex1:27017", "maxbsonobjectsize" : 16777216, "maxmessagesizebytes" : 48000000, "maxwritebatchsize" : 1000, "localtime" : isodate("2014-11-19t16:23:21.612z"), "maxwireversion" : 2, "minwireversion" : 0, "ok" : 1 }
we use db.setslaveok() worked.
is expected? in 2.4, see - master : false, , me != primary.
thanks,
Comments
Post a Comment