MongoDB 错误汇总
错误1. ERROR: child process failed, exited with error number 100
可能原因:
1.没有正确关闭服务
2.服务已经启动
3.conf文件的参数配置错误。
错误2. "errmsg" : "not authorized on admin to execute command { shutdown: 1.0, $clusterTime: { clusterTime: Timestamp(1519725156, 1), signature: { hash: BinData(0, 476DC7E7EFED899078F2044EA1E58163CC9D5BC9), keyId: 6527148863013257217 } }, $db: \"admin\" }"
没有权限执行相关命令,可以通过验证相关权限,或者使用账号密码登入。
use admin;
db.auth("test","test") 注意这里是逗号
然后再执行相关命令。
错误3. "errmsg" : "Quorum check failed because not enough voting nodes responded; required 2 but only the following 1 voting nodes responded: localhost.localdomain:27017; the following nodes did not respond affirmatively: localhost:27018 failed with not authorized on admin to execute command { replSetHeartbeat: \"rsmxqtest\", pv: 1, v: 2, from: \"localhost.localdomain:27017\", fromId: 0, checkEmpty: false }",
1.创建一个keyfile
openssl rand -base64 756 > /mongodb27010/autokey
chmod 400 /mongodb27010/autokey
2.将keyfile拷贝到其他从节点
3.在每个节点的conf文件中添加keyfile
keyFile = /mongodb27010/autokey
错误4. "errmsg" : "not master and slaveOk=false"
设置从节点允许读操作
rs.slaveOk();
错误5:child process failed, exited with error number 48
原因:非正常关闭mongo进程导致的,比如进行kill操作、断电关机等。
处理办法:
1.运行--repair修复命令
mongod -f /rs-b-1/mongod.conf --repair
2.查看mogod进程是否正常
ps -ef|grep mongo
3.以正常方式启动
备注: 作者:pursuer.chen 博客:http://www.cnblogs.com/chenmh 本站点所有随笔都是原创,欢迎大家转载;但转载时必须注明文章来源,且在文章开头明显处给明链接,否则保留追究责任的权利。 《欢迎交流讨论》 |