草庐IT

mongodb - 数据库错误 MongoDB : disappeared database

coder 2023-10-28 原文

启动了非常多的进程。然后重新启动服务器,数据库消失了。 当我走进rockmongo的时候,还没有看到老的数据库。有一个新的数据库管理员,仅此而已。

 db.serverStatus()
{
        "host" : "host",
        "version" : "2.0.6",
        "process" : "mongod",
        "uptime" : 1041,
        "uptimeEstimate" : 1037,
        "localTime" : ISODate("2012-07-26T08:20:40.729Z"),
        "globalLock" : {
                "totalTime" : 1041408230,
                "lockTime" : 330771,
                "ratio" : 0.0003176189610101314,
                "currentQueue" : {
                        "total" : 0,
                        "readers" : 0,
                        "writers" : 0
                },
                "activeClients" : {
                        "total" : 0,
                        "readers" : 0,
                        "writers" : 0
                }
        },
        "mem" : {
                "bits" : 64,
                "resident" : 19,
                "virtual" : 114,
                "supported" : true,
                "mapped" : 0,
                "mappedWithJournal" : 0
        },
        "connections" : {
                "current" : 11,
                "available" : 808
        },
        "extra_info" : {
                "note" : "fields vary by platform",
                "heap_usage_bytes" : 3623360,
                "page_faults" : 2
        },
        "indexCounters" : {
                "btree" : {
                        "accesses" : 0,
                        "hits" : 0,
                        "misses" : 0,
                        "resets" : 0,
                        "missRatio" : 0
                }
        },
        "backgroundFlushing" : {
                "flushes" : 17,
                "total_ms" : 0,
                "average_ms" : 0,
                "last_ms" : 0,
                "last_finished" : ISODate("2012-07-26T08:20:19.341Z")
        },
        "cursors" : {
                "totalOpen" : 0,
                "clientCursors_size" : 0,
                "timedOut" : 0
        },
        "network" : {
                "bytesIn" : 4429,
                "bytesOut" : 14192,
                "numRequests" : 56
        },
        "opcounters" : {
                "insert" : 0,
                "query" : 22,
                "update" : 0,
                "delete" : 0,
                "getmore" : 0,
                "command" : 54
        },
        "asserts" : {
                "regular" : 0,
                "warning" : 14,
                "msg" : 0,
                "user" : 0,
                "rollovers" : 0
        },
        "writeBacksQueued" : false,
        "dur" : {
                "commits" : 29,
                "journaledMB" : 0,
                "writeToDataFilesMB" : 0,
                "compression" : 0,
                "commitsInWriteLock" : 0,
                "earlyCommits" : 0,
                "timeMs" : {
                        "dt" : 3045,
                        "prepLogBuffer" : 0,
                        "writeToJournal" : 0,
                        "writeToDataFiles" : 0,
                        "remapPrivateView" : 0
                }
        },
        "ok" : 1
}

mongodb.log

    {
            "assertion" : "file /var/lib/mongodb/baza.4 open/create failed in create                                                                             PrivateMap (look in log for more information)",
            "assertionCode" : 13636,
            "errmsg" : "db assertion failure",
            "ok" : 0
    }

Thu Jul 26 12:05:44 [conn5] ERROR: mmap private failed with out of memory. (64 bit build)
Thu Jul 26 12:05:44 [conn5] Assertion: 13636:file /var/lib/mongodb/baza.4 open/create failed in createPrivateMap (look in log for more information)
0x5848a2 0x75dcea 0x75e8e3 0x8a8c3b 0x8a0962 0x8a1d03 0x8a1fda 0x8a2835 0x898619 0x898ea3 0x982bd5 0x97c4f4 0x97dbfd 0x940f05 0x943a30 0x889107 0x88dcd9 0xaa0bc8 0x6389f7 0x2b76122978ca 
 /usr/bin/mongod(_ZN5mongo11msgassertedEiPKc+0x112) [0x5848a2]
 /usr/bin/mongod(_ZN5mongo8MongoMMF13finishOpeningEv+0x1ca) [0x75dcea]
 /usr/bin/mongod(_ZN5mongo8MongoMMF6createESsRyb+0x63) [0x75e8e3]
 /usr/bin/mongod(_ZN5mongo13MongoDataFile4openEPKcib+0x14b) [0x8a8c3b]
 /usr/bin/mongod(_ZN5mongo8Database7getFileEiib+0x102) [0x8a0962]
 /usr/bin/mongod(_ZN5mongo8Database12openAllFilesEv+0x33) [0x8a1d03]
 /usr/bin/mongod(_ZN5mongo8DatabaseC1EPKcRbRKSs+0x1ca) [0x8a1fda]
 /usr/bin/mongod(_ZN5mongo14DatabaseHolder11getOrCreateERKSsS2_Rb+0x605) [0x8a2835]
 /usr/bin/mongod(_ZN5mongo6Client7Context11_finishInitEb+0x2e9) [0x898619]
 /usr/bin/mongod(_ZN5mongo6Client7ContextC1ERKSsSsPNS_9mongolockEb+0x73) [0x898ea3]
 /usr/bin/mongod(_ZN5mongo16CmdListDatabases3runERKSsRNS_7BSONObjEiRSsRNS_14BSONObjBuilderEb+0x215) [0x982bd5]
 /usr/bin/mongod(_ZN5mongo11execCommandEPNS_7CommandERNS_6ClientEiPKcRNS_7BSONObjERNS_14BSONObjBuilderEb+0x6c4) [0x97c4f4]
 /usr/bin/mongod(_ZN5mongo12_runCommandsEPKcRNS_7BSONObjERNS_11_BufBuilderINS_16TrivialAllocatorEEERNS_14BSONObjBuilderEbi+0x6fd) [0x97dbfd]
 /usr/bin/mongod(_ZN5mongo11runCommandsEPKcRNS_7BSONObjERNS_5CurOpERNS_11_BufBuilderINS_16TrivialAllocatorEEERNS_14BSONObjBuilderEbi+0x35) [0x940f05]
 /usr/bin/mongod(_ZN5mongo8runQueryERNS_7MessageERNS_12QueryMessageERNS_5CurOpES1_+0x1740) [0x943a30]
 /usr/bin/mongod() [0x889107]
 /usr/bin/mongod(_ZN5mongo16assembleResponseERNS_7MessageERNS_10DbResponseERKNS_11HostAndPortE+0x559) [0x88dcd9]
 /usr/bin/mongod(_ZN5mongo16MyMessageHandler7processERNS_7MessageEPNS_21AbstractMessagingPortEPNS_9LastErrorE+0x78) [0xaa0bc8]
 /usr/bin/mongod(_ZN5mongo3pms9threadRunEPNS_13MessagingPortE+0x287) [0x6389f7]
 /lib/libpthread.so.0(+0x68ca) [0x2b76122978ca]
Thu Jul 26 12:05:52 [initandlisten] connection accepted from 127.0.0.1:41970 #11

~#免费-ltm

             total       used       free     shared    buffers     cached
Mem:          1400        196       1203          0          0          0
Low:          1400        196       1203
High:            0          0          0
-/+ buffers/cache:        196       1203
Swap:            0          0          0
Total:        1400        196       1203

~# cat/proc/sys/vm/overcommit_memory

0

~# cat/proc/sys/vm/overcommit_ratio

50

~# ulimit -a

core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 16382
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) unlimited
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited

更新: 解决方案:禁用日志。

最佳答案

您得到的错误表明数据仍然存在,但在映射数据文件时出现了问题。这一行是您首先需要查看的内容:

Thu Jul 26 12:05:44 [conn5] Assertion: 13636:file /var/lib/mongodb/baza.4 open/create failed in createPrivateMap (look in log for more information)

检查该文件(以及数据路径中的其他文件)的权限,确保从那个角度看没有任何问题。

接下来是内存不足的错误:

Thu Jul 26 12:05:44 [conn5] 错误:mmap 私有(private)失败,内存不足。 (64 位构建)

您可能遇到了这个错误:https://jira.mongodb.org/browse/SERVER-6414

因此,您可以尝试 2.0.7,其中包含对此的修复,发布候选版本可在 downloads page 上获得在撰写本文时。

最后,如果您有选择,您可以通过增加此实例的内存(如果它是某种虚拟机)来解决此问题,就运行 MongoDB 实例而言,1.4GB 的 RAM 并不是很多。

关于mongodb - 数据库错误 MongoDB : disappeared database,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11665559/

有关mongodb - 数据库错误 MongoDB : disappeared database的更多相关文章

  1. ruby-on-rails - Rails 常用字符串(用于通知和错误信息等) - 2

    大约一年前,我决定确保每个包含非唯一文本的Flash通知都将从模块中的方法中获取文本。我这样做的最初原因是为了避免一遍又一遍地输入相同的字符串。如果我想更改措辞,我可以在一个地方轻松完成,而且一遍又一遍地重复同一件事而出现拼写错误的可能性也会降低。我最终得到的是这样的:moduleMessagesdefformat_error_messages(errors)errors.map{|attribute,message|"Error:#{attribute.to_s.titleize}#{message}."}enddeferror_message_could_not_find(obje

  2. ruby - 解析 RDFa、微数据等的最佳方式是什么,使用统一的模式/词汇(例如 schema.org)存储和显示信息 - 2

    我主要使用Ruby来执行此操作,但到目前为止我的攻击计划如下:使用gemsrdf、rdf-rdfa和rdf-microdata或mida来解析给定任何URI的数据。我认为最好映射到像schema.org这样的统一模式,例如使用这个yaml文件,它试图描述数据词汇表和opengraph到schema.org之间的转换:#SchemaXtoschema.orgconversion#data-vocabularyDV:name:namestreet-address:streetAddressregion:addressRegionlocality:addressLocalityphoto:i

  3. ruby-on-rails - 迷你测试错误 : "NameError: uninitialized constant" - 2

    我遵循MichaelHartl的“RubyonRails教程:学习Web开发”,并创建了检查用户名和电子邮件长度有效性的测试(名称最多50个字符,电子邮件最多255个字符)。test/helpers/application_helper_test.rb的内容是:require'test_helper'classApplicationHelperTest在运行bundleexecraketest时,所有测试都通过了,但我看到以下消息在最后被标记为错误:ERROR["test_full_title_helper",ApplicationHelperTest,1.820016791]test

  4. ruby-on-rails - 如何在 Rails View 上显示错误消息? - 2

    我是rails的新手,想在form字段上应用验证。myviewsnew.html.erb.....模拟.rbclassSimulation{:in=>1..25,:message=>'Therowmustbebetween1and25'}end模拟Controller.rbclassSimulationsController我想检查模型类中row字段的整数范围,如果不在范围内则返回错误信息。我可以检查上面代码的范围,但无法返回错误消息提前致谢 最佳答案 关键是您使用的是模型表单,一种显示ActiveRecord模型实例属性的表单。c

  5. 使用 ACL 调用 upload_file 时出现 Ruby S3 "Access Denied"错误 - 2

    我正在尝试编写一个将文件上传到AWS并公开该文件的Ruby脚本。我做了以下事情:s3=Aws::S3::Resource.new(credentials:Aws::Credentials.new(KEY,SECRET),region:'us-west-2')obj=s3.bucket('stg-db').object('key')obj.upload_file(filename)这似乎工作正常,除了该文件不是公开可用的,而且我无法获得它的公共(public)URL。但是当我登录到S3时,我可以正常查看我的文件。为了使其公开可用,我将最后一行更改为obj.upload_file(file

  6. ruby-on-rails - 错误 : Error installing pg: ERROR: Failed to build gem native extension - 2

    我克隆了一个rails仓库,我现在正尝试捆绑安装背景:OSXElCapitanruby2.2.3p173(2015-08-18修订版51636)[x86_64-darwin15]rails-v在您的Gemfile中列出的或native可用的任何gem源中找不到gem'pg(>=0)ruby​​'。运行bundleinstall以安装缺少的gem。bundleinstallFetchinggemmetadatafromhttps://rubygems.org/............Fetchingversionmetadatafromhttps://rubygems.org/...Fe

  7. ruby - #之间? Cooper 的 *Beginning Ruby* 中的错误或异常 - 2

    在Cooper的书BeginningRuby中,第166页有一个我无法重现的示例。classSongincludeComparableattr_accessor:lengthdef(other)@lengthother.lengthenddefinitialize(song_name,length)@song_name=song_name@length=lengthendenda=Song.new('Rockaroundtheclock',143)b=Song.new('BohemianRhapsody',544)c=Song.new('MinuteWaltz',60)a.betwee

  8. ruby-on-rails - 每次我尝试部署时,我都会得到 - (gcloud.preview.app.deploy) 错误响应 : [4] DEADLINE_EXCEEDED - 2

    我是Google云的新手,我正在尝试对其进行首次部署。我的第一个部署是RubyonRails项目。我基本上是在关注thisguideinthegoogleclouddocumentation.唯一的区别是我使用的是我自己的项目,而不是他们提供的“helloworld”项目。这是我的app.yaml文件runtime:customvm:trueentrypoint:bundleexecrackup-p8080-Eproductionconfig.ruresources:cpu:0.5memory_gb:1.3disk_size_gb:10当我转到我的项目目录并运行gcloudprevie

  9. ruby - Ruby 有 `Pair` 数据类型吗? - 2

    有时我需要处理键/值数据。我不喜欢使用数组,因为它们在大小上没有限制(很容易不小心添加超过2个项目,而且您最终需要稍后验证大小)。此外,0和1的索引变成了魔数(MagicNumber),并且在传达含义方面做得很差(“当我说0时,我的意思是head...”)。散列也不合适,因为可能会不小心添加额外的条目。我写了下面的类来解决这个问题:classPairattr_accessor:head,:taildefinitialize(h,t)@head,@tail=h,tendend它工作得很好并且解决了问题,但我很想知道:Ruby标准库是否已经带有这样一个类? 最佳

  10. ruby-on-rails - Rails 5 Active Record 记录无效错误 - 2

    我有两个Rails模型,即Invoice和Invoice_details。一个Invoice_details属于Invoice,一个Invoice有多个Invoice_details。我无法使用accepts_nested_attributes_forinInvoice通过Invoice模型保存Invoice_details。我收到以下错误:(0.2ms)BEGIN(0.2ms)ROLLBACKCompleted422UnprocessableEntityin25ms(ActiveRecord:4.0ms)ActiveRecord::RecordInvalid(Validationfa

随机推荐