Mongodb 错误集锦
文章平均质量分 60
Mongodb 错误集锦
雅冰石
DBA
展开
-
mongo库起不来,日志显示一直在build index
启动mongod时加上--noIndexBuildRetry参数来跳过索引重建转载 2022-09-01 08:57:59 · 411 阅读 · 0 评论 -
ERROR: child process failed, exited with error number 14
一 问题描述之前做的用systemctl方式启动mongo,有一次节点被异常终止,同事手动启动mongo的时候没用systemctl方式起,而是用mongod -f 配置文件这种方式启动的。数据库起来了,但是后来想用systemctl方式起,却起不来了,报错:ERROR: child process failed, exited with error number 14我手动用mongo用户执行mongod -f 配置文件也无法启动mongo,也是报一样的错误。二 出错原因同事是用roo原创 2021-12-02 14:00:21 · 3661 阅读 · 0 评论 -
mongod_shard2.service: main process exited, code=killed, status=9/KILL
一 问题描述11月19日中午同事反馈,河南mongo(192.168.192.82-84)业务受影响,当时排查,发现shard3被宕掉了两个进程,shard2被宕掉了一个进程。当时通过启动进程恢复了业务。后听同事说11月20日上午mongo又发生了异常宕机的问题,通过临时启动mongo进程恢复了业务。二 排查思路2.1 查看11月20日哪个mongo进程宕机了#这里通过mongo的启动日期判断发现11月20日宕掉了两个shard2,1个shard3。2.2 .原创 2021-11-26 16:50:58 · 6152 阅读 · 0 评论 -
[initandlisten] Detected unclean shutdown - /var/lib/mongo/mongod.lock is not empty
一 问题描述mongo起不来,日志里有如下报错:2020-12-29T09:31:29.933+0800 W - [initandlisten] Detected unclean shutdown - /var/lib/mongo/mongod.lock is not empty.2020-12-29T09:31:29.933+0800 E NETWORK [initandlisten] Failed to unlink socket file /tmp/mongodb-27017....转载 2020-12-29 09:57:14 · 1496 阅读 · 0 评论 -
mongodb启动报错:key are too open
添加参数clusterAuthMode=keyFilekeyFile=/usr/local/mongodb/conf/keyFilers0.keymongodb 启动时报错2016-03-18T10:39:58.889+0800 I CONTROL [main] ***** SERVER RESTARTED *****2016-03-18T10:39:58.918+0转载 2017-07-03 14:31:28 · 4709 阅读 · 0 评论 -
"errmsg" : "Our replica set config is invalid or we are not a member of it"
查看副本集状态,报错:> rs.status();{"state" : 10,"stateStr" : "REMOVED","uptime" : 93,"optime" : Timestamp(1478239977, 594),"optimeDate" : ISODate("2016-11-04T06:12:57Z"),"ok" : 0,"errmsg" : "原创 2016-11-07 14:58:21 · 7389 阅读 · 1 评论 -
Mongodb建函数
定义函数:db.system.js.insert({ _id : "TestConcat", value : functionTestConcat(s1, s2){ returns1 + s2 } });运行函数:原创 2015-08-14 13:43:12 · 3019 阅读 · 0 评论 -
mongodb脚本从windows上传到linux无法执行
一:问题描述这几次执行mongodb初始化脚本,发现一个问题:将windows下的脚本上传到Linux下后,执行时,会报错。如:mongo -u root -p mongo123 admin --port 8000 initdata-bmis.log initdata-bmis.log文件里有很多错误:SyntaxError: Unexpected token I原创 2015-08-31 11:37:12 · 1371 阅读 · 0 评论 -
SyntaxError: Unexpected identifier at a.js
一:问题描述有时候,初始化数据时,命令条数太多,直接复制insert语句,粘贴到命令行里执行的话,挺慢的(时间全花在粘贴上面了),所以把语句都放入js文件里执行,比较方便些。但是,我今天第一次执行js文件时,报错:[root@ser107 baidandan]# mongo -u root -p --authenticationDatabase admin a.js原创 2015-08-04 16:54:14 · 6233 阅读 · 0 评论 -
not authorized on test to execute command { $eval: \"return 1111\"
一:问题描述>db.eval('TestConcat("abc","123")');2015-03-04T15:18:54.062+0800 { "ok": 0, "errmsg": "not authorized on test to execute command { $eval: \"return 1111\转载 2015-08-14 13:36:06 · 5953 阅读 · 0 评论 -
could not verify config servers were active and reachable before write
启动mongos时,config server的配置信息不得使用localhost、127.0.0.1,否则添加其它机器的shard时,会出现错误提示:"can’t use localhost as a shard since all shards need to communicate. either use all shards and configdbs in localhost or转载 2015-07-21 16:56:56 · 2598 阅读 · 0 评论 -
rs.initiate(config); {"ok" : 0, "errmsg" : "couldn't initiate : need all members up to initiate, not
一:问题描述今天在初始化mongodb副本集时报错:[root@ser6-51 ~]# mongoMongoDB shell version: 2.6.9connecting to: test> use admin;switched to db admin > config = { _id:"MyReplset", members:[... {_i原创 2015-07-15 16:13:03 · 6148 阅读 · 0 评论 -
Error creating index admin.system.version: 13 err: "not authorized to create index on admin.system.v
一:问题描述今天在做全库恢复的时候报错:[root@ser6-52 myTest]# mongorestore -u superuser -p 123 --authenticationDatabase admin /backup/mongodb/full_bak_201507021651.bak/connected to: 127.0.0.12015-07-02T17:原创 2015-07-03 09:59:09 · 2535 阅读 · 0 评论 -
Failed: error connecting to db server: server returned error on SASL authentication step: Authentica
一:问题描述备份时,报错:[root@ser6-51 ~]# mongodump -d myTest -o /backup/mongodb/all_bak_20150619.bak -u=superuser -p=1234562015-06-29T10:17:10.784+0800 Failed: error connecting to db server: server ret转载 2015-06-29 10:43:55 · 17905 阅读 · 0 评论