加入收藏 | 设为首页 | 会员中心 | 我要投稿 聊城站长网 (https://www.0635zz.com/)- 智能语音交互、行业智能、AI应用、云计算、5G!
当前位置: 首页 > 服务器 > 系统 > 正文

mongo启动发生错误

发布时间:2023-09-22 15:38:09 所属栏目:系统 来源:
导读:show collections;

uncaught exception: error{"$err": "not master and slaveok=false","code":13435}

进一步查看mongo日志:

unauthorized: not authorized on admin to execute command { replsetge
show collections;
 
uncaught exception:  error{"$err": "not master and slaveok=false","code":13435}
 
进一步查看mongo日志:
 
unauthorized: not authorized on admin to execute command { replsetgetstatus: 1.0,for shell: 1.0}
 
通过日志查看了mongo的conf参数文件的配置:
 
取消了replset,keyFile的参数,恢复正常。
 
在secondary模式下,是不允许读写操作的(错误提示:not master and slave false),临时处理:rs.slave.OK()
 
备注:因为异常中断导致重启生成子进程报错,通常情况都是在db_data目录中存在了一个mongo加锁的文件,后缀名为lock,直接remove。
 
 
 

(编辑:聊城站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章