喜旎果 发表于 2015-7-10 07:02:43

MongoDB的“not master and slaveok=false”错误解决

  在客户端操作MongoDB时经常会如下错误:



SECONDARY> show collections;
Fri Jul 18 17:36:53 uncaught exception: error: { "$err" : "not master and slaveok=false", "code" : 13435 }
  原因是从服务器上的数据库是不允许进行读写操作,所以就会报类似于这样的错误。
  强制解决的办法:



SECONDARY> rs.slaveOk();
页: [1]
查看完整版本: MongoDB的“not master and slaveok=false”错误解决