iwind/rockmongo

Cant read off slaves

Opened this issue · 1 comments

Greetings, I would like to use RockMongo to allow our Product team to run analytics on a hidden replica attached to our production replica set.

However, I keep getting the following error:

not master and slaveOk=false

I did some Google'ing and it looks like some folks had some workarounds with setSlaveOkay(true) in app/models/MServer.php, but nothing seems to be working. Any help would be extremely appreciated.

Thanks!

fgm commented

This happens because you have a version of the Mongo extension including MongoClient, in which case RockMongo instantiates MongoClient, instead of Mongo, and MongoClient does not carry the deprecated setSlaveOkay() method, but expected use of setReadPreference(). PR is #110 .