MongoDB非正常关闭后修复记录

MongoDB非正常关闭后修复记录

mongod没有后台执行,在终端连接非正常断开后,再次执行mongod报错,如下所示:

[root@sunrise16 bin]# ./mongod
./mongod --help for help and startup options
Tue Oct 25 19:49:02
Tue Oct 25 19:49:02 warning: 32-bit servers don't have journaling enabled by default. Please use --journal if you want durability.
Tue Oct 25 19:49:02
Tue Oct 25 19:49:02 [initandlisten] MongoDB starting : pid=13626 port=27017 dbpath=/data/db/ 32-bit host=sunrise16
Tue Oct 25 19:49:02 [initandlisten]
Tue Oct 25 19:49:02 [initandlisten] ** NOTE: when using MongoDB 32 bit, you are limited to about 2 gigabytes of data
Tue Oct 25 19:49:02 [initandlisten] **       see http://blog.mongodb.org/post/137788967/32-bit-limitations
Tue Oct 25 19:49:02 [initandlisten] **       with --journal, the limit is lower
Tue Oct 25 19:49:02 [initandlisten]
Tue Oct 25 19:49:02 [initandlisten] db version v2.0.0, pdfile version 4.5
Tue Oct 25 19:49:02 [initandlisten] git version: 695c67dff0ffc361b8568a13366f027caa406222
Tue Oct 25 19:49:02 [initandlisten] build info: Linux domU-12-31-39-01-70-B4 2.6.21.7-2.fc8xen #1 SMP Fri Feb 15 12:39:36 EST 2008 i686 BOOST_LIB_VERSION=1_37
Tue Oct 25 19:49:02 [initandlisten] options: {}
**************
Unclean shutdown detected.
Please visit http://dochub.mongodb.org/core/repair for recovery instructions.
*************
Tue Oct 25 19:49:02 [initandlisten] exception in initAndListen: 12596 old lock file, terminating
Tue Oct 25 19:49:02 dbexit:
Tue Oct 25 19:49:02 [initandlisten] shutdown: going to close listening sockets...
Tue Oct 25 19:49:02 [initandlisten] shutdown: going to flush diaglog...
Tue Oct 25 19:49:02 [initandlisten] shutdown: going to close sockets...
Tue Oct 25 19:49:02 [initandlisten] shutdown: waiting for fs preallocator...
Tue Oct 25 19:49:02 [initandlisten] shutdown: closing all files...
Tue Oct 25 19:49:02 [initandlisten] closeAllFiles() finished
Tue Oct 25 19:49:02 dbexit: really exiting now

 

http://www.mongodb.org/display/DOCS/Durability+and+Repair#DurabilityandRepair-RepairCommand 写道
Repair Command

When not using journaling (--nojournal), after a machine crash or kill -9 termination, run the repairDatabase command. This command will check all data for corruption, remove any corruption found, and compact data files a bit. Repair is analogous to running fsck for a file system.

When journaling is enabled, it should not be necessary to run repair. However one could still use the repair command to compact a database.

From the command line:

mongod --repair

From the shell (you have to do for all dbs including local if you go this route):

> db.repairDatabase();

During a repair operation, mongod must store temporary files to disk. By default, mongod creates temporary directories under the dbpath for this purpose. Alternatively, the --repairpath command line option can be used to specify a base directory for temporary repair files.

Note that repair is a slow operation which inspects the entire database.

After running with --repair, mongod will start up normally.
 

现在执行修复。
[root@sunrise16 bin]# ./mongod --repair
Tue Oct 25 19:50:21
Tue Oct 25 19:50:21 warning: 32-bit servers don't have journaling enabled by default. Please use --journal if you want durability.
Tue Oct 25 19:50:21
Tue Oct 25 19:50:21 [initandlisten] MongoDB starting : pid=14452 port=27017 dbpath=/data/db/ 32-bit host=sunrise16
Tue Oct 25 19:50:21 [initandlisten]
Tue Oct 25 19:50:21 [initandlisten] ** NOTE: when using MongoDB 32 bit, you are limited to about 2 gigabytes of data
Tue Oct 25 19:50:21 [initandlisten] **       see http://blog.mongodb.org/post/137788967/32-bit-limitations
Tue Oct 25 19:50:21 [initandlisten] **       with --journal, the limit is lower
Tue Oct 25 19:50:21 [initandlisten]
Tue Oct 25 19:50:21 [initandlisten] db version v2.0.0, pdfile version 4.5
Tue Oct 25 19:50:21 [initandlisten] git version: 695c67dff0ffc361b8568a13366f027caa406222
Tue Oct 25 19:50:21 [initandlisten] build info: Linux domU-12-31-39-01-70-B4 2.6.21.7-2.fc8xen #1 SMP Fri Feb 15 12:39:36 EST 2008 i686 BOOST_LIB_VERSION=1_37
Tue Oct 25 19:50:21 [initandlisten] options: { repair: true }
Tue Oct 25 19:50:22 [initandlisten] ****
Tue Oct 25 19:50:22 [initandlisten] ****
Tue Oct 25 19:50:22 [initandlisten] need to upgrade database mydb with pdfile version 4.5, new version: 4.5
Tue Oct 25 19:50:22 [initandlisten]      starting upgrade
Tue Oct 25 19:50:22 [initandlisten]  mydb repairDatabase mydb
Tue Oct 25 19:50:22 [FileAllocator] allocating new datafile /data/db/$tmp_repairDatabase_0/mydb.ns, filling with zeroes...
Tue Oct 25 19:50:22 [FileAllocator] creating directory /data/db/$tmp_repairDatabase_0/_tmp
Tue Oct 25 19:50:26 [FileAllocator] done allocating datafile /data/db/$tmp_repairDatabase_0/mydb.ns, size: 16MB,  took 4 secs
Tue Oct 25 19:50:26 [FileAllocator] allocating new datafile /data/db/$tmp_repairDatabase_0/mydb.0, filling with zeroes...
Tue Oct 25 19:50:30 [FileAllocator] done allocating datafile /data/db/$tmp_repairDatabase_0/mydb.0, size: 16MB,  took 4.004 secs
Tue Oct 25 19:50:30 [FileAllocator] allocating new datafile /data/db/$tmp_repairDatabase_0/mydb.1, filling with zeroes...
Tue Oct 25 19:50:30 [initandlisten] build index mydb.things { _id: 1 }
Tue Oct 25 19:50:30 [initandlisten] build index done 22 records 0.008 secs
Tue Oct 25 19:50:38 [FileAllocator] done allocating datafile /data/db/$tmp_repairDatabase_0/mydb.1, size: 32MB,  took 7.981 secs
Tue Oct 25 19:50:38 [initandlisten] ****
Tue Oct 25 19:50:38 [initandlisten] ****
Tue Oct 25 19:50:38 [initandlisten] need to upgrade database test with pdfile version 4.5, new version: 4.5
Tue Oct 25 19:50:38 [initandlisten]      starting upgrade
Tue Oct 25 19:50:38 [initandlisten]  test repairDatabase test
Tue Oct 25 19:50:38 [FileAllocator] allocating new datafile /data/db/$tmp_repairDatabase_0/test.ns, filling with zeroes...
Tue Oct 25 19:50:38 [FileAllocator] creating directory /data/db/$tmp_repairDatabase_0/_tmp
Tue Oct 25 19:50:42 [FileAllocator] done allocating datafile /data/db/$tmp_repairDatabase_0/test.ns, size: 16MB,  took 3.995 secs
Tue Oct 25 19:50:42 [FileAllocator] allocating new datafile /data/db/$tmp_repairDatabase_0/test.0, filling with zeroes...
Tue Oct 25 19:50:46 [FileAllocator] done allocating datafile /data/db/$tmp_repairDatabase_0/test.0, size: 16MB,  took 4.06 secs
Tue Oct 25 19:50:46 [FileAllocator] allocating new datafile /data/db/$tmp_repairDatabase_0/test.1, filling with zeroes...
Tue Oct 25 19:50:46 [initandlisten] build index test.foo { _id: 1 }
Tue Oct 25 19:50:46 [initandlisten] build index done 1 records 0 secs
Tue Oct 25 19:50:54 [FileAllocator] done allocating datafile /data/db/$tmp_repairDatabase_0/test.1, size: 32MB,  took 8.031 secs
Tue Oct 25 19:50:54 [initandlisten] finished checking dbs
Tue Oct 25 19:50:54 dbexit:
Tue Oct 25 19:50:54 [initandlisten] shutdown: going to close listening sockets...
Tue Oct 25 19:50:54 [initandlisten] shutdown: going to flush diaglog...
Tue Oct 25 19:50:54 [initandlisten] shutdown: going to close sockets...
Tue Oct 25 19:50:54 [initandlisten] shutdown: waiting for fs preallocator...
Tue Oct 25 19:50:54 [initandlisten] shutdown: closing all files...
Tue Oct 25 19:50:54 [initandlisten] closeAllFiles() finished
Tue Oct 25 19:50:54 [initandlisten] shutdown: removing fs lock...
Tue Oct 25 19:50:54 dbexit: really exiting now

 

现在正常启动mongod。
[root@sunrise16 bin]# ./mongod
./mongod --help for help and startup options
Tue Oct 25 19:51:00
Tue Oct 25 19:51:00 warning: 32-bit servers don't have journaling enabled by default. Please use --journal if you want durability.
Tue Oct 25 19:51:00
Tue Oct 25 19:51:00 [initandlisten] MongoDB starting : pid=14459 port=27017 dbpath=/data/db/ 32-bit host=sunrise16
Tue Oct 25 19:51:00 [initandlisten]
Tue Oct 25 19:51:00 [initandlisten] ** NOTE: when using MongoDB 32 bit, you are limited to about 2 gigabytes of data
Tue Oct 25 19:51:00 [initandlisten] **       see http://blog.mongodb.org/post/137788967/32-bit-limitations
Tue Oct 25 19:51:00 [initandlisten] **       with --journal, the limit is lower
Tue Oct 25 19:51:00 [initandlisten]
Tue Oct 25 19:51:00 [initandlisten] db version v2.0.0, pdfile version 4.5
Tue Oct 25 19:51:00 [initandlisten] git version: 695c67dff0ffc361b8568a13366f027caa406222
Tue Oct 25 19:51:00 [initandlisten] build info: Linux domU-12-31-39-01-70-B4 2.6.21.7-2.fc8xen #1 SMP Fri Feb 15 12:39:36 EST 2008 i686 BOOST_LIB_VERSION=1_37
Tue Oct 25 19:51:00 [initandlisten] options: {}
Tue Oct 25 19:51:00 [initandlisten] waiting for connections on port 27017
Tue Oct 25 19:51:00 [websvr] admin web console waiting for connections on port 28017

Tue Oct 25 19:52:00 [clientcursormon] mem (MB) res:12 virt:92 mapped:0
Tue Oct 25 19:57:00 [clientcursormon] mem (MB) res:12 virt:92 mapped:0

 

...

 

 

 

【新能源汽车DCDC变换器测试优化全攻略:解决电能质量/发热/过充等核心痛点】 高压直流转12V低压的DCDC变换器是新能源汽车电源系统的核心枢纽,承担着为整车低压附件、控制器及12V蓄电池供电/补电的关键作用。在新能源汽车乘用车、商用车等不同车型实际运营中,因PDU内DC/AC等模块干扰、DCDC自身设计缺陷、整车匹配性不佳及测试验证不充分,频发12V输出电能质量差导致后端元器件烧毁、变换器发热严重、蓄电池过充/欠充、智能补电功能失效等问题,还伴随低压侧电压瞬跌/浪涌、电磁干扰超标、振动后接触不良、高温下效率骤降等行业高频故障,直接影响整车可靠性和运营安全性。本文基于国标。 阅读详情

相关推荐

A*(star)算法原理讲解以及程序实现(基于Python)

本文将以迷宫探索最优路径为例,讲解A *搜索算法原理及其程序实现。在原理讲解部分,首先从为什么要使用A *搜索算法和A *搜索算法的全局最优逻辑出发,讲解A *算法的原理。其次对A *的行动函数g(n)和启发函数h(n)的细节进行了讲解说明,并补充了启发函数的选择对于A *算法的影响。在程序实现部分,首先从程序流程框图出发,解释A *算法的流程。其次按函数的类划分并讲解主要代码,接着展示程序的运行结果,最后对A *算法进行总结分析。

m0_73366745的博客 8280

【MongDB】非正常关闭导致的不能启动的解决方法

mongdb 非正常关闭导致的不能启动的解决方法 服务器断电、异常关闭以及直接killall命令导致服务终止的情况都可能会被mondodb认为是unclean shutdown, 因为unclean shutdown可能会导致数据不一致性或者数据损坏,所以必须要手动修复后才能继续提供服务。 mongodb修复unclean shutdown的方式有: 1、从journal修复,journa...

我其实发现我还是适合当厨师 901

告别迷茫!手把手教你用Synopsys VC USB VIP搭建验证平台(附UVM分层序列实战解析)

本文详细介绍了如何使用Synopsys VC USB VIP搭建验证平台,并深入解析UVM分层序列的实战应用。通过Step-by-Step的操作指南和关键配置示例,帮助验证工程师高效集成USB VIP,掌握从环境搭建到测试用例开发的全套技能,特别适合处理复杂协议验证的挑战。

weixin_42520573的博客 552

启动mongodb遇到的错:warning: 32-bit servers don't have journaling enabled by deflity

执行修复:mongod --repair即可 正常关闭:killall mongod 转载于:https://www.cnblogs.com/fun0623/p/4694049.html

weixin_30757793的博客 346

ubuntu 18.04 + Kimera slam 安装与demo测试

环境:opencv 3.4.12,其他的都是按照文档下载的。 首先进行组件的安装 一、Kimera-VIO 安装参考文档:https://github.com/MIT-SPARK/Kimera-VIO/blob/master/docs/kimera_vio_install.md 按照文档装就好,在安装过程中碰到如下问题: 0、make 过程很卡,不要用所有的核 1、cmake过程中卡下载 ORBvoc.zip ,手动下载这个文件,解压,将里面的3个文件,放到/Kimera-VIO/vocabu.

dna葡萄糖的博客 3628

【各种轮子2】基于Icepak的PCB散热仿真比较

随着电子产品的集成度越来越高,PCB板的尺寸越来越小,板级芯片散热的问题越来越成为电子工程师的一个重要挑战。对于板级芯片散热,主要依靠工程师对PCB自身的设计进行优化,同时要兼顾系统的尺寸和成本。本文分别从芯片角度和PCB角度进行建模,芯片模型选用QFN封装,PCB模型采用走线导入模型,探讨了芯片结构,PCB铜厚,PCB叠层厚度对芯片散热的影响。

3668

mongoDB非正常关闭后无法启动问题

2019独角兽企业重金招聘Python工程师标准>>> ...

weixin_34248023的博客 414

语音增强评价指标全解析:从MOS到eSTOI的实战指南

本文全面解析了语音增强领域的核心评价指标,包括主观评价的黄金标准MOS,以及PESQ、STOI、eSTOI等关键客观指标。文章详细阐述了各指标的原理、适用场景与实战计算方法,并提供了Python代码示例,旨在帮助开发者和研究者建立科学的评估体系,以平衡语音可懂度与音质,从而优化算法效果。

yhn456789的博客 1198

修复MongoDB数据库,解决因Unclean Shutdown导致服务不能启动的问题

今天原本想研究点mongodb的东西,发现服务启不来了: [root@biao ~]# mongod -f /etc/mongod.conf forked process: 19465 all output going to: /mongodb/log/mongodb.log [root@biao ~]# service mongod status m

千古悠悠何所愁的专栏 1万+

金蝶云星空-协同开发云-安装开发环境

金蝶协同开发云就是不需要每一个开发都在自己的本机安装开发环境,自己安装可容易出错,包括源代码管理也一并解决了,大大减少了开发人员的工作量和降低了上手的难度。

qq_33881408的博客 5596

9、傅里叶变换:连续时间与离散时间信号分析的核心工具

本文深入探讨了傅里叶变换在连续时间和离散时间信号分析中的核心作用,详细介绍了连续时间傅里叶变换(CTFT)和离散时间傅里叶变换(DTFT)的定义、性质及其应用。文章涵盖了傅里叶级数到傅里叶变换的推导过程、常见变换对、系统分析中的关键性质,并讨论了采样后频谱的周期延拓与混叠问题。此外,还展示了傅里叶变换在滤波器设计、通信系统调制解调等实际场景中的应用,最后展望了其在图像处理、生物医学等领域的广阔前景。

jump7的博客 67

MongoDB非正常关闭后修复记录 mongod --repair

mongod没有后台执行,在终端连接非正常断开后,再次执行mongod报错,如下所示: [root@localhost mongodb]# ./bin/mongod./bin/mongod --help for help ...

ciyoumie0113的博客 1904

Codex 实战 Skills:用 Skill 自动识别并提取 PDF/图片表格数据,效率提升 10 倍

本文介绍如何构建一个多模态文件解析 Skill,用于自动识别和提取 PDF/图片中的表格数据,提升 AI 智能体处理非结构化文档的效率。文章分析了传统方法的局限性,提出分层解析架构(预处理、检测、提取推理、后处理),推荐技术栈包括 pdfplumber、OpenCV 和多模态大模型。详细说明了 Skill 的元数据定义、数据模型设计(使用 Pydantic)和核心实现流程,通过混合策略实现从复杂文档到结构化 JSON/Markdown 的转换,使 AI 代理具备"阅读"多模态文档的能力。

yueyeguzhuo的专栏 301

mongodb的环境搭建

MongoDB是非关系类型的数据库,

寄情于码 786

廖雪峰Python教程[完整版]

廖雪峰的python教程整理的,已经排好版了,而且还是完整的,适合小白

文档:亲测可用解决vnc灰屏,黑屏,鼠标大黑叉情况

主要解决vnc-viewer灰屏,黑屏,鼠标大黑叉等现象,详细见文档。

【MangoDB】mongodb异常关闭后,再启动需要删除mongod.lock文件

mongod.lock文件是mongo服务端启动后在硬盘中创建的一个锁文件, 如果你正常退出mongod服务,该文件即使还存在,也不会影响下一次启动mongod服务的。 这个文件还会记录mongod在运行过程中的一些状态,以便在正常重新启动服务时能够获取异常信息提示。 非正常关闭了mongoDB,重启错误信息如下:  01 Tue Apr 17 11:13:30  02 Tue Apr 17...

我其实发现我还是适合当厨师 6662

VC中sqlite的使用

在VC中对sqlite的使用,实现数据库大批数据的快速插入,读取数据库中的数据在ListCtrl中显示

MongoDB-启动的时候出现了问题(转载)

之前MongoDB启动的时候是蛮正常的,不知道后来启动报错了,就把粘贴出来查询了。最后才知道是由于自己不正常的关闭导致的这个情况。 --摘录:MongoDB非正常关闭后修复记录   mongod没有后台执行,在终端连接非正常断开后,再次执行mongod报错,如下所示: [root@localhost mongodb]# ./bin/mongod ./bin/mongod --help f...

wb284551926的博客 342

Mongodb上一次非正常关闭后修复

rm -rf /data/mongodb/data/puf_sfap/mongod.lock rm -rf /data/mongodb/data/puf_sfap/WiredTiger.lock /data/mongodb/bin/mongod --repair -f /data/mongodb/config/mongod.conf -nojournal --repairpath /data/mo

gotobar的专栏 3829

MacOS 下MongoDB非正常关闭后无法启动,无法repair后,如何进行数据恢复的方法之一

MacOS 下 mongodb无法启动、MacOS 下mongodb无法repair的时候,MacOS 下mongodb数据恢复方法,MacOS 下mongodb灾难恢复

1971

MongoDb非正常关闭后重启遇到问题

/*********MongoDB重启遇到错误、 about to fork child process, waiting until server is ready for connections. forked process: 10117 ERROR: child process failed, exited with error number 48 To see additional in...

appcanLiYunLong的博客 2668

mongodb报错lockbusy_mongodb 中data lock解决方法

之前MongoDB启动的时候是蛮正常的,不知道后来启动报错了,就把粘贴出来查询了。最后才知道是由于自己不正常的关闭导致的这个情况。--摘录:MongoDB非正常关闭后修复记录mongod没有后台执行,在终端连接非正常断开后,再次执行mongod报错,如下所示:[root@localhost mongodb]# ./bin/mongod ./bin/mongod --help for help an...

weixin_39684228的博客 753

mongodb 客户端_MongoDb非正常关闭后重启

MongoDB重启遇到错误about to fork child process, waiting until server is ready for connections.forked process: 10117ERROR: child process failed, exited with error number 48To see additional information in th...

weixin_39905226的博客 517

mongodb启动出现问题解决方法。

之前MongoDB启动的时候是蛮正常的,不知道后来启动报错了,就把粘贴出来查询了。最后才知道是由于自己不正常的关闭导致的这个情况。 --摘录:MongoDB非正常关闭后修复记录   mongod没有后台执行,在终端连接非正常断开后,再次执行mongod报错,如下所示: [root@localhost mongodb]# ./bin/mongod ./bin/mongod --help for

CJaver的专栏 2259

journal 重启_MongoDb非正常关闭后重启

MongoDB重启遇到错误about to fork child process, waiting until server is ready for connections.forked process: 10117ERROR: child process failed, exited with error number 48To see additional information in th...

weixin_31479991的博客 218

Linux下MongoDB非正常关闭启动异常解决方法

1、将配置信息写入一个文件中 vim mongo.conf 里面写如下内容: dbpath=/usr/local/mongodb/data/ logpath=/usr/local/mongodb/logs/mongodb.log logappend=true port=27017 fork=true 2、启动mongod /usr/lo...

weixin_30814329的博客 1777
上一篇: Bash字符串处理(与Java对照) - 22.判断字符串是否数字串
下一篇: MongoDB下查询数组的尝试记录
codingstandards
博客等级 码龄16年 12粉丝 3原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值