简体   繁体   English

如何mongorestore 2.6.11转储到3.2.5系统?

[英]How to mongorestore 2.6.11 dump to 3.2.5 system?

I've noticed an anomaly after performing a mongorestore from a 2.6.11 dump (from another system) to a 3.2.5 system. 在从2.6.11转储(从另一个系统)到3.2.5系统执行mongorestore之后,我注意到了一个异常。 In a nutshell, the names of the collection files on the new system (in /var/lib/mongodb ) are named differently and follow this format: 简而言之, 系统上的收集文件的名称(在/var/lib/mongodb )以不同的方式命名,并遵循以下格式:

collection-55--6670716476518949126.wt
index-1--6670716476518949126.wt

Whereas on the old system, the collections were in /home/mongodb and followed this naming convention: 在旧系统上,集合位于/home/mongodb并遵循以下命名约定:

collection_name.0
collection_name.1
collection_name.ns

Strangely, everything seems to be "working" though, even though the ~150MB collection file sizes on the old system aren't represented in the new collection file sizes (which are ~150kb). 奇怪的是,尽管旧系统上的〜150MB收集文件大小未在新的收集文件大小(约150kb)中表示,但一切似乎都在“工作”。

I was following the answer in: 我在跟踪答案:

How to migrate MongoDB 2.6 to 3.0 with WiredTiger 如何使用WiredTiger将MongoDB 2.6迁移到3.0

Which basically suggests: 这基本上表明:

  • Perform mongodump . 执行mongodump
  • Stop mongod 停止mongod
  • Upgrade MongoDB version 升级MongoDB版本
  • Convert the old config file at /etc/mongod.conf to the new YAML format. /etc/mongod.conf的旧配置文件转换为新的YAML格式。
  • Restart mongod 重新启动mongod
  • Perform the mongorestore on the dump. 在转储上执行mongorestore

As I am doing a mongorestore to a fresh MongoDB 3.2.5 install, however, I already have a config file in the YAML format (see below). 但是,当我执行mongorestore到全新的MongoDB 3.2.5安装时,我已经具有YAML格式的配置文件(请参见下文)。

So the only step it seems I need to do is the mongorestore - which I have done and resulted in the anomalies noted above. 因此,似乎唯一需要执行的步骤是mongorestore我已完成并导致了上述异常。

My questions are: 我的问题是:

01) Are there any other steps I should have performed? 01)我应该执行其他步骤吗?

02) Are these file naming 'anomalies' expected? 02)是否应将这些文件命名为“异常”?

03) Why is there such a large discrepancy in collection file sizes? 03)为什么收集文件的大小有如此大的差异?

I ask in order to avoid any problems that may arise later due to missing an important step. 我要求以避免由于错过重要步骤而可能在以后出现的任何问题。

/etc/mongod.conf /etc/mongod.conf

# mongod.conf

# for documentation of all options, see:
#   http://docs.mongodb.org/manual/reference/configuration-options/

# Where and how to store data.
storage:
  dbPath: /var/lib/mongodb
  journal:
    enabled: true
#  engine:
#  mmapv1:
#  wiredTiger:

# where to write logging data.
systemLog:
  destination: file
  logAppend: true
  path: /var/log/mongodb/mongod.log

# network interfaces
net:
  port: 27017
  bindIp: 127.0.0.1


#processManagement:

#security:

#operationProfiling:

#replication:

#sharding:

## Enterprise-Only Options:

#auditLog:

#snmp:

the file names are correct as mongoDb uses now wired tiger as default storage engine. 该文件名正确,因为mongoDb现在使用有线Tiger作为默认存储引擎。 The size associated can be different as WT uses different approach when storing documents in file 关联的大小可能不同,因为WT将文件存储在文件中时使用不同的方法

see more here 在这里看到更多

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM