mongoDB Error:not master and slaveOk=false
2017-03-08 00:00
1676 查看
摘要: { "ok" : 0, "errmsg" : "not master and slaveOk=false", "code" : 13435 }
今天在使用mongoDB时,使用以下命令,想看一下集合的时候:
报了下面的错:
重点是这句:
拿去百度了一下,发现这是一个正常的情况,由于读写分离,SECONDARY不允许读写的,所以会报这个ERROR。
如果偏要解决的话,执行下面的命令:
OK~~~
今天在使用mongoDB时,使用以下命令,想看一下集合的时候:
SECONDARY> show collections
报了下面的错:
2017-03-08T17:15:31.037+0800 E QUERY [thread1] Error: listCollections failed: { "ok" : 0, "errmsg" : "not master and slaveOk=false", "code" : 13435 } : _getErrorWithCode@src/mongo/shell/utils.js:25:13 DB.prototype._getCollectionInfosCommand@src/mongo/shell/db.js:773:1 DB.prototype.getCollectionInfos@src/mongo/shell/db.js:785:19 DB.prototype.getCollectionNames@src/mongo/shell/db.js:796:16 shellHelper.show@src/mongo/shell/utils.js:754:9 shellHelper@src/mongo/shell/utils.js:651:15 @(shellhelp2):1:1
重点是这句:
"errmsg" : "not master and slaveOk=false"
拿去百度了一下,发现这是一个正常的情况,由于读写分离,SECONDARY不允许读写的,所以会报这个ERROR。
如果偏要解决的话,执行下面的命令:
SECONDARY> rs.slaveOk();
OK~~~
相关文章推荐
- MongoDB的“not master and slaveok=false”错误解决
- MongoDb的“not master and slaveok=false”错误及解决方法
- MongoDb的“not master and slaveok=false”错误及解决方法
- MongoDb的“not master and slaveok=false”错误及解决方法
- MongoDb的“not master and slaveok=false”错误及解决方法
- MongoCursorException ***not master and slaveOk=false
- not master and slaveOk=false
- 【MongoDB】MongoDb的“not master and slaveok=false”错误及解决方法
- MongoDb的“not master and slaveok=false”错误及解决方法
- MongoDb的“not master and slaveok=false”错误及解决方法,读写分离
- MongoDb的“not master and slaveok=false”错误及解决方法
- MongoDb的"not master and slaveok=false"错误及解决方法
- "$err" : "not master and slaveok=false", "code" : 13435
- NOT MASTER AND SLAVEOK=FALSE
- uncaught exception: error: { "$err" : "not master and slaveOk=false", "code" : 13435 }
- Table definition on master and slave does not match
- Table definition on master and slave does not match(坑爹的编码)
- Do not request Window.FEATURE_ACTION_BAR and set windowActionBar to false 错误
- CocoaPods问题: CocoaPods was not able to update the `master` repo.if it is a unexpected issue and
- master and slave have equal MySQL server UUIDs 解决方法