"errmsg" : "not master and slaveOk=false","code" : 13435,"codeName" : "NotMasterNoSlaveOk"
code not and quot Master false
2023-09-27 14:26:42 时间
当在SECONDARY 节点读取操作,报如下错误: rs0:SECONDARY> show tables; 2020-08-26T10:34:53.196+0800 E QUERY [thread1] Error: listCollections failed: { "operationTime" : Timestamp(1598409284, 2), "ok" : 0, "errmsg" : "not master and slaveOk=false", "code" : 13435, "codeName" : "NotMasterNoSlaveOk", "$clusterTime" : { "clusterTime" : Timestamp(1598409284, 2), "signature" : { "hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="), "keyId" : NumberLong(0) } } } : 原因: SECONDARY 是不允许读写操作的。 解决方法一: 在SECONDARY 节点中执行 rs.slaveOk(); 解决方法二:添加到js文件中,连接mongo时,启动shell的时候自动加载。 vi ~/.mongorc.js rs.slaveOk();
相关文章
- 毕昇编译器优化:Lazy Code Motion
- Gitea 无法启动提示 (code=exited, status=203/exec) 错误
- 我们是怎么做Code Review的
- 极客头条 | 5月17日科技要闻:Stack Overflow 遭黑客入侵;中国首条 5G 覆盖地铁诞生;VS Code 1.34 发布!
- 机器学习笔记之在Visual Studio Code中使用Jupyter Notebook
- Gtest:Using visual studio 2017 cross platform feature to compile code remotely
- 问题整理:Jenkins报错:...@tmp/durable-e71c5c44/script.sh: docker: not found script returned exit code 127
- 基于Visual Studio Code搭建Vue开发环境
- HTTP Status Code
- 更新证书错误Code Sign error: Provisioning profile ‘XXXX'can't be found
- 使用VS Code开发ASP.NET Core 应用程序
- Git和Code Review流程