mongo升级,现在我的数据不兼容

时间:2018-08-10 01:37:58

标签: mongodb upgrade wiredtiger

我今天在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,但这没有帮助。

2 个答案:

答案 0 :(得分:0)

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

一切都很好,谢谢。

答案 1 :(得分:-2)

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

sudo rm -rf /数据/数据库 须藤mkdir / data / db 须藤chmod 777 / data / db