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();

posted on 2012-08-04 15:36  还是刀哥靠谱  阅读(61249)  评论(1编辑  收藏  举报

导航