count failed: not master{ "note" : "from execCommand", "ok" : 0, "errmsg" : "not master" } at src/mongo/shell/query.js:191在SECONDARY节点无法show dbs
count failed: not master{ "note" : "from execCommand", "ok" : 0, "errmsg" : "not master" } at src/mongo/shell/query.js:191
在SECONDARY节点无法show dbs
主从启动之后,连接slave可以成功连上,但是在slave中执行 show dbs 的时候就报错了:
QUERY Error: listDatabases failed:{ "note" : "from execCommand", "ok" : 0, "errmsg" : "not master" }
解决方法:
在报错的slave机器上执行 rs.slaveOk()方法即可。
解释一下具体slaveOk方法是什么意思?
Provides a shorthand for the following operation:
db.getMongo().setSlaveOk()
This allows the current connection to allow read operations to run on secondary members. See the readPref() method for more fine-grained control over read preference in the mongo shell.
count failed: not master{ "note" : "from execCommand", "ok" : 0, "errmsg" : "not master" } at src/mongo/shell/query.js:191在SECONDARY节点无法show dbs的更多相关文章
- OERR: ORA-1410 "invalid ROWID" Master Note / Troubleshooting, Diagnostic and Solution (文档ID 1410.1)
OERR: ORA-1410 "invalid ROWID" Master Note / Troubleshooting, Diagnostic and Solution (文档I ...
- Master Note for Transportable Tablespaces (TTS) -- Common Questions and Issues (Doc ID 1166564.1)
APPLIES TO: Oracle Database Cloud Exadata Service - Version N/A and laterOracle Database Cloud Servi ...
- Master Note: Undo 空间使用率高 (Doc ID 1578639.1)
Master Note: High Undo Space Usage (Doc ID 1578639.1) APPLIES TO: Oracle Database Cloud Schema Servi ...
- k8s1.13.0二进制部署-master节点(三)
部署apiserver 创建生成CSR的JSON配置文件 [root@k8s-master1 ssl]# vim kubernetes-csr.json { "CN": " ...
- Failed RMAN Catalog Upgrade from 11.2.0.2 to 12.1.0.2 ( ORA-02296 RMAN-06004 )
Failed RMAN Catalog Upgrade from 11.2.0.2 to 12.1.0.2 ( ORA-02296 RMAN-06004 ) 由于后期使用12c的数据库,需要对现有 ...
- 开发错误记录3:问题 Error:failed to find Build Tools revision 23.0.2
今天导入swiperefreshlayoutdemo 问题 Error:failed to find Build Tools revision 23.0.2 修改build.gradle 里面设置,其 ...
- 403.14-Forbidden Web 服务器被配置为不列出此目录的内容及Login on failed for "IIS APPPOOL\ASP.NET v4.0"问题
问题1: 发布mvc3报错:403.14-Forbidden Web 服务器被配置为不列出此目录的内容 折腾了半天,提示里面的解决方法是: 如果不希望启用目录浏览,请确保配置了默认文档并且该文件存在. ...
- 17.1.1.7 Setting Up Replication with New Master and Slaves 设置复制使用新的master和slaves:
17.1.1.7 Setting Up Replication with New Master and Slaves 设置复制使用新的master和slaves: 最简单和最直接方式是设置复制使用新的 ...
- iis7 发布mvc3 遇到的HTTP错误 403.14-Forbidden Web 服务器被配置为不列出此目录的内容及Login on failed for "IIS APPPOOL\ASP.NET v4.0"问题
问题1: 发布mvc3报错:403.14-Forbidden Web 服务器被配置为不列出此目录的内容 折腾了半天,提示里面的解决方法是: 如果不希望启用目录浏览,请确保配置了默认文档并且该文件存在. ...
随机推荐
- 开启mysql远程访问
一.登陆mysql以后执行以下命令: GRANT ALL ON *.* TO username@'%' IDENTIFIED BY 'password' WITH GRANT OPTION; FLUS ...
- EasyGui
EasyGui 在IDLE上运行EasyGui可能存在冲突 EasyGui是运行在Tkinter上并哟拥有自身的事件循环,而IDLE也是Tkinter写的一个应用程序并页拥有自身的事件循环.两者同时运 ...
- HDU ACM Fibonacci
Problem Description Fibonacci numbers are well-known as follow: Now given an integer N, please find ...
- Djano + Nginx + docker配置与管理
在配置这个服务之前,应该对docker的基本安装与使用应该很熟悉了.下面开始直接不如正题 1.让我们创建一个名为myproject的空目录,并在src名称内添加另一个文件夹.src应该包含django ...
- 外网访问vmvare
使用端口映射即可,以tplink wr886n为例, 方法如下: 1.打开浏览器,输入默认ip192.168.0.1回车登录: 2.登录对话框,输入 密码点击确定: 3.点击转发规则--虚拟服务器,点 ...
- ubuntu16配置mysql5.7主从同步
测试环境如下: master: 10.0.0.26 slave01: 10.0.0.27 slave02: 10.0.0.28 一.三台机均安装mysql-server5.7 $ sudo apt-g ...
- no newline at the end of file
[no newline at the end of file] 修复这个警告,在文件结尾回车一下就行了. 这么规定的初衷是,为了每一行都要以换行结束. 因为行尾的/表示连接下一行,如果一个文件最后一 ...
- fhq-treap模板
模板保存. #include<iostream> #include<cstdio> #include<cstring> #include<ctime> ...
- c++ 组合模式(composite)
原文地址:http://www.cnblogs.com/jiese/p/3168844.html 当你发现需求中是体现部分与整体层次的结构时,以及你希望用户可以忽略组合对象与单个对象的不同,统一地使用 ...
- servlet01 项目demo、servlet生命周期
1 环境说明 jdk: 1.8 tomcat: 8.0 2 项目demo 2.1 新建一个动态的web项目 2.2 新建一个servlet类 该类必须继承 HttpServlet 技巧01:Htt ...