当mongo搭建的是replica set集群。
如果你登录某一台SECONDARY节点执行命令 show dbs报错
2022-08-16T15:20:00.606+0800 E  QUERY    [js] uncaught exception: Error: listDatabases failed:{
    "operationTime" : Timestamp(1660634399, 2),
    "ok" : 0,
    "errmsg" : "not master and slaveOk=false",
    "code" : 13435,
    "codeName" : "NotMasterNoSlaveOk",
    "$clusterTime" : {
        "clusterTime" : Timestamp(1660634399, 2),
        "signature" : {
            "hash" : BinData(0,"NPF356c5NKl0PqHLlmiQ9vey9e4="),
            "keyId" : NumberLong("7101680539345616897")
        }
    }
} :
_getErrorWithCode@src/mongo/shell/utils.js:25:13
Mongo.prototype.getDBs/<@src/mongo/shell/mongo.js:147:19
Mongo.prototype.getDBs@src/mongo/shell/mongo.js:99:12
shellHelper.show@src/mongo/shell/utils.js:906:13
shellHelper@src/mongo/shell/utils.js:790:15
@(shellhelp2):1:1
是因为SECONDARY节点没有执行show dbs命令的权限。
此时有两种解决方案
1.登录PRIMARY节点
2.使用集群的方式连接
mongo --host  testmongo/ip:port,ip:port,ip:port -uusername -p'passwd' --authenticationDatabase admin

[js] uncaught exception: Error: listDatabases failed相关推荐

  1. uncaught exception: Error: couldn’t add user: No role named root@myblog : 报错的解决方法

    uncaught exception: Error: couldn't add user: No role named root@myblog : 报错的解决方法 说明 最近在学习 MongoDB创建 ...

  2. 2021-05-04T23:26:32.208+0800 E QUERY [js] Error: listDatabases failed:{ “ok“ : 0,

    解决办法:mongo --port 27017 -u "root" -p "root" --authenticationDatabase "admin ...

  3. Vue使用echarts报错提示 vue.runtime.esm.js?2b0e:1897 Error: Initialize failed: invalid dom.

    在Vue脚手架+antd搭建的项目中使用Antd的Tabs标签页进行切换时,B页面的Echarts不进行渲染,而且报错提示 说Dom无效,思考了一下原因应该是切换页面后,本页面的dom还未渲染,但是已 ...

  4. throw new Error(‘Electron failed to install correctly, please delete node_modules/electron and try

    问题: cmd命令下执行Electron -v直接报如下错误: D:\nvm\v16.14.2\node_modules\electron\index.js:17 throw new Error('E ...

  5. echarts.js:1136 Uncaught Error: Initialize failed: invalid dom.

    1.错误描述 echarts.js:1136 Uncaught Error: Initialize failed: invalid dom. 2.错误原因 <!DOCTYPE html>& ...

  6. proxy代理报错: Uncaught (in promise) Error: Request failed with status code 500

    POST http://localhost:8013/check/login 500 (Internal Server Error) createError.js:16 Uncaught (in pr ...

  7. Error: Message failed: 554 5.2.0 STOREDRV.Submission.Exception:OutboundSpamException;

    office 365 SMTP outlook 拍错 Error: Message failed: 554 5.2.0 STOREDRV.Submission.Exception:OutboundSp ...

  8. Uncaught (in promise) Error: Request failed with status code 500

    分享一些状态码400 404 500等原因: 出错: 前端: // 获取所有的导航菜单async getMenuList(){const {data:res} = await this.$http.g ...

  9. axios请求报Uncaught (in promise) Error: Request failed with status code 404

    使用axios处理请求时,出现的问题解决 当url是远程接口链接时,会报404的错误: Uncaught (in promise) Error: Request failed with status ...

最新文章

  1. 清华数为DWF低代码平台亮相2021全球数字经济大会
  2. 基于Mysql主从同步的读写分离
  3. linux 系统打造man中文帮助手册图解
  4. Spring Boot项目无法找到getMediaTypeMappings()方法
  5. vs2017 linux so导出函数,将Visual Studio 2017中的Assembly和C ++与命令行和输出相结合
  6. 【机器视觉】 dev_set_preferences算子
  7. 使用Guava对并发应用程序进行基于对象的微锁定
  8. qnetworkreply 获取状态_谈谈Unity Shader中的采样器状态和(Texture Filtering)纹理滤波方式
  9. 多线程顺序打印的5种解法
  10. dedecms和php有什么关系,dedecms和用PHP自己编写的程序做网站有什么区别?哪一种更好一点...
  11. Rust之字符串,元组,数组,切片,打印优化
  12. 15-struct(构造函数,重载)
  13. 漫谈Linux标准的文件系统(Ext2/Ext3/Ext4)
  14. 啊哈算法—解救小哈(深度优先搜索)
  15. 中南大学c语言课程设计报告,中南大学 C++课程设计报告.doc
  16. Java二叉树数据结构原理
  17. wooyun 历史资源汇总
  18. 登录英雄联盟显示正在连接服务器,windows10系统登录英雄联盟出现连接不上服务器如何解决...
  19. 考研日语线上笔记(六):完型专项篇
  20. 安全组-出入战规则设置

热门文章

  1. MySQL与Oracle的应用区别
  2. 懂商业的技术合伙人(10):伟大的乔帮主,从不滥用绝学'降龙十八掌'
  3. [LaTeX] 数学表达式-上标和下标
  4. 深圳计算机中级职称如何申请,深圳中级职称评定有何流程
  5. Vector Commitment Techniques and Applications to Verifiable Decentralized Storage学习笔记
  6. 未雨绸缪 高瞻远瞩的网络运
  7. fatal: loose object...is corrupt解决方法
  8. 2021年煤矿安全检查考试APP及煤矿安全检查找答案
  9. 如何才能做好员工培训工作?
  10. mac报错Could not resolve proxy: “”