MongoDb的“not master and slaveok=false”错误及解决方法

在SECONDARY查询出发现如下错误:

SECONDARY> show collections;
Sat Aug  4 15:29:00 uncaught exception: error: { "$err" : "not master and slaveok=false", "code" : 13435 }

这是正常的,因为SECONDARY是不允许读写的,如果非要解决,方法如下:

SECONDARY> rs.slaveOk();

 

猜你喜欢

转载自paynexss.iteye.com/blog/2392611
今日推荐