日记和非日记Mongodb数据库有什么区别 [英] What is the difference between journal and non journal Mongodb database

查看:102
本文介绍了日记和非日记Mongodb数据库有什么区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚安装了mongodb 32位版本,这是我启动mongodb时在终端上显示的消息

i just installed mongodb 32 bit version, this is the message which prints in my terminal when i start mongodb

Server has startup warnings: 
Wed Jul 16 09:53:43.759 [initandlisten] 
Wed Jul 16 09:53:43.759 [initandlisten] ** NOTE: This is a 32 bit MongoDB binary. 
Wed Jul 16 09:53:43.759 [initandlisten] **       32 bit builds are limited to less than 2GB of data (or less with --journal).
Wed Jul 16 09:53:43.759 [initandlisten] **       Note that journaling defaults to off for 32 bit and is currently off.
Wed Jul 16 09:53:43.759 [initandlisten] **       See http://dochub.mongodb.org/core/32bit
Wed Jul 16 09:53:43.759 [initandlisten] 
>

从这里我注意到或理解了两件事,我的mongodb数据库仅限于存储少于2gb的数据库

From here i noticed or understood 2 things, my mongodb database is limited to storage of less than 2gb database

未记录日记,

日记化使空间进一步减小

Journalizing makes the space decrease much further

我想知道

  1. 此日记/非期刊mongodb数据库是什么

  1. what is this journal/non-journal mongodb database

日记数据库比非日记数据库有什么优势,反之亦然?

what is the advantage of journal database over nonjournal database or vice versa?

是否有必要记录我的数据库?

Is it necessary to journal my database?

请帮助我

谢谢

推荐答案

在MongoDB中,它使用预写日志记录来检查是否已执行write操作或编写crash report这称为日志记录

In MongoDB it uses write ahead logging to check whether a write operation is performed or to write a crash report this called journaling

如果存在no journaling,则说明您正在进行数百万笔交易.如果某些交易可能崩溃或不完全终止.您将不会发现任何痕迹.因此如何找到问题的根源并予以恢复

If there is no journaling say you work on millions of transaction . if some transaction may be crashed or incompletely terminated . there will be no trace for you to know the issue. so how can one find the where does the issue occurred and recover it

其他情况就像数据库是否意外存在,您将不知道原因

other situations are like if db has exists unexpectedly you will not able to know the reason

文档中明确指出

没有日志,如果mongod意外退出,则必须假定数据处于不一致状态,并且必须运行repair或, 最好从副本集的干净成员重新同步.和 启用日记功能,如果mongod意外停止,则程序可以 恢复写入日志的所有内容,并且数据保留在 一致的状态.默认情况下,最大程度的丢失写入, 即未在日记本中创建的那些是最近100个中创建的那些 毫秒.有关更多信息,请参见commitIntervalMs. 默认值.

Without a journal, if mongod exits unexpectedly, you must assume your data is in an inconsistent state, and you must run either repair or, preferably, resync from a clean member of the replica set. With journaling enabled, if mongod stops unexpectedly, the program can recover everything written to the journal, and the data remains in a consistent state. By default, the greatest extent of lost writes, i.e., those not made to the journal, are those made in the last 100 milliseconds. See commitIntervalMs for more information on the default.

这篇关于日记和非日记Mongodb数据库有什么区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆