zoukankan      html  css  js  c++  java
  • 【MongoDB】MongoDb的“not master and slaveok=false”错误及解决方法 mongo连接从库出现问题

    链接mongodb报错如下

    2016-03-14T16:26:00.912+0800 E QUERY    [thread1] Error: listDatabases failed:{ "ok" : 0, "errmsg" : "not master and slaveOk=false", "code" : 13435 } :
    _getErrorWithCode@src/mongo/shell/utils.js:23:13
    Mongo.prototype.getDBs@src/mongo/shell/mongo.js:53:1
    shellHelper.show@src/mongo/shell/utils.js:700:19
    shellHelper@src/mongo/shell/utils.js:594:15
    @(shellhelp2):1:1

    错误代码:

    Error: listDatabases failed:{ "ok" : 0, "errmsg" : "not master and slaveOk=false", "code" : 13435 }

    这是正常的,因为mgset-742285:SECONDARY是不允许读写的,如果非要解决,方法如下:

    mgset-742285:SECONDARY> rs.slaveOk();
  • 相关阅读:
    temp12
    temp111
    test.c
    vipLogin.c
    services.c
    request.c
    managerLogin.c
    将博客搬至CSDN
    SpringMabatis整合项目mybatis-configuration.xml核心配置
    logback-test.xml配置文件模板
  • 原文地址:https://www.cnblogs.com/zhaoyingjie/p/10087283.html
Copyright © 2011-2022 走看看