【问题标题】:MongoDB error: shutting down with code:62MongoDB 错误:使用代码关闭:62
【发布时间】:2019-01-17 03:20:41
【问题描述】:

是的,还有其他非常相似的问题。但是,这个错误的原因似乎不同。

我启动 MongoDB 一次,它在我指定的数据文件夹中运行良好。当我再次运行它(有时)时,它突然不再工作并给我以下输出日志:

2018-01-31T00:31:39.636-0800 I CONTROL  [initandlisten] MongoDB starting : pid=12248 port=27017 dbpath=C:\Users\20173591\Documents\GitHub\prijzen-volger\data 64-bit host=20173591
2018-01-31T00:31:39.636-0800 I CONTROL  [initandlisten] targetMinOS: Windows 7/Windows Server 2008 R2
2018-01-31T00:31:39.638-0800 I CONTROL  [initandlisten] db version v3.6.2
2018-01-31T00:31:39.641-0800 I CONTROL  [initandlisten] git version: 489d177dbd0f0420a8ca04d39fd78d0a2c539420
2018-01-31T00:31:39.641-0800 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.1u-fips  22 Sep 2016
2018-01-31T00:31:39.642-0800 I CONTROL  [initandlisten] allocator: tcmalloc
2018-01-31T00:31:39.642-0800 I CONTROL  [initandlisten] modules: none
2018-01-31T00:31:39.643-0800 I CONTROL  [initandlisten] build environment:
2018-01-31T00:31:39.643-0800 I CONTROL  [initandlisten]     distmod: 2008plus-ssl
2018-01-31T00:31:39.644-0800 I CONTROL  [initandlisten]     distarch: x86_64
2018-01-31T00:31:39.645-0800 I CONTROL  [initandlisten]     target_arch: x86_64
2018-01-31T00:31:39.646-0800 I CONTROL  [initandlisten] options: { net: { port: 27017 }, storage: { dbPath: "C:\Users\20173591\Documents\GitHub\prijzen-volger\data" } }
2018-01-31T00:31:39.650-0800 I -        [initandlisten] Detected data files in C:\Users\20173591\Documents\GitHub\prijzen-volger\data created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2018-01-31T00:31:39.651-0800 I STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=3523M,session_max=20000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),statistics_log=(wait=0),verbose=(recovery_progress),
2018-01-31T00:31:39.832-0800 I STORAGE  [initandlisten] WiredTiger message [1517387499:832376][12248:140720232489296], txn-recover: Main recovery loop: starting at 12/768
2018-01-31T00:31:39.953-0800 I STORAGE  [initandlisten] WiredTiger message [1517387499:952865][12248:140720232489296], txn-recover: Recovering log 12 through 13
2018-01-31T00:31:40.034-0800 I STORAGE  [initandlisten] WiredTiger message [1517387500:33883][12248:140720232489296], txn-recover: Recovering log 13 through 13
2018-01-31T00:31:40.162-0800 I CONTROL  [initandlisten]
2018-01-31T00:31:40.162-0800 I CONTROL  [initandlisten] ** WARNING: Access control is not enabled for the database.
2018-01-31T00:31:40.163-0800 I CONTROL  [initandlisten] **          Read and write access to data and configuration is unrestricted.
2018-01-31T00:31:40.164-0800 I CONTROL  [initandlisten]
2018-01-31T00:31:40.166-0800 I CONTROL  [initandlisten] ** WARNING: This server is bound to localhost.
2018-01-31T00:31:40.167-0800 I CONTROL  [initandlisten] **          Remote systems will be unable to connect to this server.
2018-01-31T00:31:40.168-0800 I CONTROL  [initandlisten] **          Start the server with --bind_ip <address> to specify which IP
2018-01-31T00:31:40.168-0800 I CONTROL  [initandlisten] **          addresses it should serve responses from, or with --bind_ip_all to
2018-01-31T00:31:40.168-0800 I CONTROL  [initandlisten] **          bind to all interfaces. If this behavior is desired, start the
2018-01-31T00:31:40.169-0800 I CONTROL  [initandlisten] **          server with --bind_ip 127.0.0.1 to disable this warning.
2018-01-31T00:31:40.169-0800 I CONTROL  [initandlisten]
2018-01-31T00:31:40.169-0800 I CONTROL  [initandlisten]
2018-01-31T00:31:40.170-0800 I CONTROL  [initandlisten] ** WARNING: The file system cache of this machine is configured to be greater than 40% of the total memory. This can lead to increased memory pressure and poor performance.
2018-01-31T00:31:40.170-0800 I CONTROL  [initandlisten] See http://dochub.mongodb.org/core/wt-windows-system-file-cache
2018-01-31T00:31:40.171-0800 I CONTROL  [initandlisten]
2018-01-31T09:31:40.181+0100 F CONTROL  [initandlisten] ** IMPORTANT: UPGRADE PROBLEM: The data files need to be fully upgraded to version 3.4 before attempting an upgrade to 3.6; see http://dochub.mongodb.org/core/3.6-upgrade-fcv for more details.
2018-01-31T09:31:40.181+0100 I NETWORK  [initandlisten] shutdown: going to close listening sockets...
2018-01-31T09:31:40.182+0100 I REPL     [initandlisten] shutdown: removing all drop-pending collections...
2018-01-31T09:31:40.182+0100 I REPL     [initandlisten] shutdown: removing checkpointTimestamp collection...
2018-01-31T09:31:40.183+0100 I STORAGE  [initandlisten] WiredTigerKVEngine shutting down
2018-01-31T09:31:40.569+0100 I STORAGE  [initandlisten] WiredTiger message [1517387500:568961][12248:140720232489296], txn-recover: Main recovery loop: starting at 13/3072
2018-01-31T09:31:40.690+0100 I STORAGE  [initandlisten] WiredTiger message [1517387500:690284][12248:140720232489296], txn-recover: Recovering log 13 through 14
2018-01-31T09:31:40.771+0100 I STORAGE  [initandlisten] WiredTiger message [1517387500:770531][12248:140720232489296], txn-recover: Recovering log 14 through 14
2018-01-31T09:31:41.010+0100 I STORAGE  [initandlisten] shutdown: removing fs lock...
2018-01-31T09:31:41.011+0100 I CONTROL  [initandlisten] now exiting
2018-01-31T09:31:41.012+0100 I CONTROL  [initandlisten] shutting down with code:62

我注意到以下消息:

2018-01-31T09:31:40.181+0100 F CONTROL  [initandlisten] ** IMPORTANT: UPGRADE PROBLEM: The data files need to be fully upgraded to version 3.4 before attempting an upgrade to 3.6; see http://dochub.mongodb.org/core/3.6-upgrade-fcv for more details.

但这是我第一次使用 MongoDB,所以数据文件不可能不是 3.6 版。我正在使用 MongoDB 版本 3.6.2 并使用 Node.js 进行条目。

是什么导致了这个问题,我怎样才能找回我的数据文件?我已经两次丢失了超过 200 万个条目,这让我很难将其加载到数据库中。

【问题讨论】:

  • 为什么要投反对票?请解释一下。
  • 找到 thisthis 但他们没有帮助?我没有投票...
  • @marekful 谢谢,第二个提供了补救措施而不是治愈方法。当我删除数据文件夹时,它可以正常工作,但是一旦我重新启动 mongoDB,就会出现升级错误。
  • 第一个呢?
  • @marekful 我昨天安装了 mongodb v3.6.2,我不相信它会在两次启动之间降级。

标签: mongodb


【解决方案1】:

我仍然不明白是什么导致了这个问题。但是,我设法解决了它。 One must downgrade from 3.6 to 3.4:

  • 下载 3.4 二进制文件 (link)
  • 使用新的 3.4 mongod.exe 文件运行您的服务器

【讨论】:

    【解决方案2】:

    全新安装后我遇到了同样的问题:

    $ brew update
    $ brew install mongodb
    $ mkdir -p /data/db
    $ sudo chown -R `id -un` /data/db
    $ mongod
    

    see console output when trying to run $ mongod

    根据documentation,如果 --dbpath 中的数据文件与当前运行的 mongod 版本不兼容,则 mongod 将返回退出代码 62。重新安装解决了这个问题:

    $ brew uninstall mongodb
    $ brew install mongod
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-09-14
      • 2019-06-19
      • 2017-06-23
      • 1970-01-01
      • 1970-01-01
      • 2017-05-16
      • 2011-08-14
      相关资源
      最近更新 更多