MongDB from execCommand not master
count failed: not master{ "note" : "from execCommand", "ok" : , "errmsg" : "not master" } at
src/mongo/shell/query.js:
在SECONDARY节点无法show dbs
主从启动之后,连接slave可以成功连上,但是在slave中执行 show dbs 的时候就报错了:
QUERY Error: listDatabases failed:{ "note" : "from execCommand", "ok" : , "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.
MongDB from execCommand not master的更多相关文章
- 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, " ...
- [MongDB] 主从架构--官方极力不推荐
一.缘由: 看着数据库大家庭都有主从模式,想着Mongodb应该也不会落下.但从官网看来,先是早先舍弃了Master-Master模式,现在又在不推荐 Master-Slave模式,这是要标新立异呀. ...
- mongDB主从
MongoDB[第二篇]MongodDB主从 官方网站:http://www.mongodb.org/ MongoDB的一些参数 --logpath 日志文件路径 --master 指定为主机器 -- ...
- Redis源码学习-Master&Slave的命令交互
0. 写在前面 Version Redis2.2.2 Redis中可以支持主从结构,本文主要从master和slave的心跳机制出发(PING),分析redis的命令行交互. 在Redis中,serv ...
- koa2 mongdb 做后端接口的小demo
现在前端全栈里面有一种技术栈比较火 前端使用 vue 或者react 后端使用 koa2 mysql数据库 或者mongdb做数据储存 但是基本这样的全栈教程 都要收费 收费就收费吧 但是 有没有遇到 ...
- mongdb 副本集的原理、搭建、应用
在了解了这篇文章之后,可以进行该篇文章的说明和测试.MongoDB 副本集(Replica Set)是有自动故障恢复功能的主从集群,有一个Primary节点和一个或多个Secondary节点组成.类似 ...
- xamarin MasterDetailPage点击Master时卡顿现象
在很多项目中经常会使用到MasterDetailPage的布局方式,而且一般做为主页面来开发,在开发中,发现一个并不算Bug的问题,但是却发生了,以此记录下来,方便大家探讨. 现象是这样的,我开发了一 ...
- backup3:master 数据库的备份和还原
在SQL Server 中,master 数据库记录系统级别的元数据,例如,logon accounts, endpoints, linked servers, and system configur ...
- 当master down掉后,pt-heartbeat不断重试会导致内存缓慢增长
最近同事反映,在使用pt-heartbeat监控主从复制延迟的过程中,如果master down掉了,则pt-heartbeat则会连接失败,但会不断重试. 重试本无可厚非,毕竟从使用者的角度来说,希 ...
随机推荐
- Python __getattribute__ vs __getattr__
# 例子在原来的基础上简化了一下,排除依赖和干扰,详细参见原项目 class UrlGenerator(object): def __init__(self, root_url): self.url ...
- Java之常用类及方法
下面我们介绍Java类库所提供的常用类及类的常用方法 一.java.lang.String 1. String类常用的构造函数 public String(String original) 使用串对象 ...
- ocx控件针对网页刷新和关闭分别进行区分处理
当ocx加载在网页上时,如果对网页执行F5刷新事件,ocx控件会销毁ocx的窗口类,但是ocx的APP类是不会销毁的. 只有当网页被关闭时,才销毁app类. --------------------- ...
- localtime 的性能问题及其替代者
在系统从redhat5升到redhat6的过程中,服务的性能差了很多.经过定位发现是程序中频繁调用localtime/localtime_r所致. 而调用localtime_r 的实现中,对时区进行了 ...
- xcode添加build phase
[xcode添加build phase] xcode版本:5.0.2,找了半天,终于找到add build phase的方法,如下图.
- SpringBoot25 gradle安装、利用gradle创建SrpingBoot项目
1 gradle安装 技巧01:gradle依赖JDK或者JRE,而且版本至少时1.7 1.1 下载安装包 到gradle官网下载安装包[PS: 也可以利用命令的方式安装,本案例是利用安装包的方式] ...
- SOAP UI
We use SoapUI-Pro-5.1.2 1. Basic introduction - Windows 2. Use project environment tab to manage the ...
- tensor 维度 问题。
tf.argmax takes two arguments: input and dimension. example: tf.argmx(arr, dimension = 1). or tf.arg ...
- CF547D Mike and Fish
欧拉回路,巧妙的解法. 发现每一个点$(x, y)$实际上是把横坐标和$x$和纵坐标$y$连一条线,然后代进去跑欧拉回路,这样里一条边对应了一个点,我们只要按照欧拉回路间隔染色即可. 注意到原图可能并 ...
- threading学习
多线程类似于同时执行多个不同程序,多线程运行有如下优点: 使用线程可以把占据长时间的程序中的任务放到后台去处理. 用户界面可以更加吸引人,这样比如用户点击了一个按钮去触发某些事件的处理,可以弹出一个进 ...