1

我今天在我的 mac 上进行了 brew 更新/升级,然后 mongodb 导致我的 mac 严重崩溃。我现在正在尝试将我的数据放入 Atlas 集群。我现在只有我的 /data/db 文件。我需要转储它们以将它们移植到 Atlas。我没有弄乱我的Mac,而是搬到了Ubuntu。在 Ubuntu 上,我安装了 mongo 3.6.6。我尝试开始mongod并收到以下消息。我用谷歌搜索并尝试了很多东西但没有成功。请指教。

root@risksheet:/opt/marc# mongod
2018-08-09T21:35:01.592-0400 I CONTROL  [initandlisten] MongoDB starting : pid=26111 port=27017 dbpath=/data/db 64-bit host=risksheet
2018-08-09T21:35:01.592-0400 I CONTROL  [initandlisten] db version v3.6.6
2018-08-09T21:35:01.592-0400 I CONTROL  [initandlisten] git version: 6405d65b1d6432e138b44c13085d0c2fe235d6bd
2018-08-09T21:35:01.592-0400 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.2g  1 Mar 2016
2018-08-09T21:35:01.592-0400 I CONTROL  [initandlisten] allocator: tcmalloc
2018-08-09T21:35:01.592-0400 I CONTROL  [initandlisten] modules: none
2018-08-09T21:35:01.592-0400 I CONTROL  [initandlisten] build environment:
2018-08-09T21:35:01.592-0400 I CONTROL  [initandlisten]     distmod: ubuntu1604
2018-08-09T21:35:01.593-0400 I CONTROL  [initandlisten]     distarch: x86_64
2018-08-09T21:35:01.593-0400 I CONTROL  [initandlisten]     target_arch: x86_64
2018-08-09T21:35:01.593-0400 I CONTROL  [initandlisten] options: {}
2018-08-09T21:35:01.593-0400 I -        [initandlisten] Detected data files in /data/db created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2018-08-09T21:35:01.593-0400 I STORAGE  [initandlisten] 
2018-08-09T21:35:01.593-0400 I STORAGE  [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
2018-08-09T21:35:01.593-0400 I STORAGE  [initandlisten] **          See http://dochub.mongodb.org/core/prodnotes-filesystem
2018-08-09T21:35:01.593-0400 I STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=991M,session_max=20000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),cache_cursors=false,compatibility=(release="3.0",require_max="3.0"),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),statistics_log=(wait=0),verbose=(recovery_progress),
2018-08-09T21:35:02.492-0400 E STORAGE  [initandlisten] WiredTiger error (-31802) [1533864902:492320][26111:0x7f9ce698c9c0], connection: Version incompatibility detected: unsupported WiredTiger file version: this build requires a maximum version of 2, and the file is version 3: WT_ERROR: non-specific WiredTiger error
2018-08-09T21:35:02.498-0400 E -        [initandlisten] Assertion: 28595:-31802: WT_ERROR: non-specific WiredTiger error src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp 421
2018-08-09T21:35:02.498-0400 I STORAGE  [initandlisten] exception in initAndListen: Location28595: -31802: WT_ERROR: non-specific WiredTiger error, terminating
2018-08-09T21:35:02.498-0400 I NETWORK  [initandlisten] shutdown: going to close listening sockets...
2018-08-09T21:35:02.498-0400 I NETWORK  [initandlisten] removing socket file: /tmp/mongodb-27017.sock
2018-08-09T21:35:02.498-0400 I CONTROL  [initandlisten] now exiting
2018-08-09T21:35:02.498-0400 I CONTROL  [initandlisten] shutting down with code:100
root@risksheet:/opt/marc# 

我也尝试将引擎设置为WiredTiger但没有帮助。

4

2 回答 2

0

这是个好主意,我也试过了。当我最终安装了正确版本的 Mongo 时,我能够读取我的 data/db 文件并转储它们。然后我可以将它们加载到最新版本中。

一切都很好,谢谢。

于 2018-08-14T11:53:28.850 回答
-6

删除 /data/db 目录并重新创建它们,授予它们权限,然后使用 mongod 重新启动

sudo rm -rf /data/db sudo mkdir /data/db sudo chmod 777 /data/db

于 2018-08-13T07:41:33.530 回答