MongoDB 3.0 发行说明

在本页面

  • 2015 年 3 月 3 日*

MongoDB 3.0 现在可用。主要功能包括对 WiredTiger 存储引擎,可插拔存储引擎 API,SCRAM-SHA-1身份验证机制和改进的explain功能的支持。

MongoDB Ops Manager(包括自动化,备份和监视)现在也可用。有关更多信息,请参见Ops Manager 文档Ops Manager 发行说明

Minor Releases

3.0.15 – 2017 年 5 月 15 日

Issues fixed:

3.0.14 – 2016 年 11 月 4 日

Issues fixed:

  • 3.0.13 上不正确的内存访问会触发分段错误:SERVER-26889

3.0.13 – 2016 年 10 月 31 日

Issues fixed:

3.0.12 – 2016 年 5 月 9 日

Issues fixed:

3.0.11 – 2016 年 3 月 31 日

Issues fixed:

  • 对于 MongoDB 3.0.9 和 MongoDB 3.0.10,在块迁移期间,对目标块中未反映的对迁移块中文档的插入和更新操作:SERVER-23425

3.0.10 – 2016 年 3 月 8 日

Issues fixed:

3.0.9 – 2016 年 1 月 26 日

Issues fixed:

3.0.8 – 2015 年 12 月 15 日

Issues fixed:

3.0.7 – 2015 年 10 月 13 日

Issues fixed:

3.0.6 – 2015 年 8 月 24 日

Issues fixed:

3.0.5 – 2015 年 7 月 28 日

解决的问题和改进:

3.0.4 – 2015 年 6 月 16 日

Issues fixed:

3.0.3 – 2015 年 5 月 12 日

Issues fixed:

3.0.2 – 2015 年 4 月 9 日

Issues fixed:

3.0.1 – 2015 年 3 月 17 日

Issues fixed:

Major Changes

可插拔存储引擎 API

MongoDB 3.0 引入了可插拔的存储引擎 API,允许第三方为 MongoDB 开发存储引擎。

WiredTiger

MongoDB 3.0 引入了对WiredTiger存储引擎的支持。有了 WiredTiger 的支持,MongoDB 现在支持两个存储引擎:

  • MMAPv1,MongoDB 的早期版本中可用的存储引擎,以及 MongoDB 3.0 的默认存储引擎,以及

  • WiredTiger,仅在 MongoDB 3.0 的 64 位版本中可用。

WiredTiger Usage

WiredTiger 是默认 MMAPv1 存储引擎的替代产品。 WiredTiger 支持所有 MongoDB 功能,包括报告服务器,数据库和集合统计信息的操作。但是,切换到 WiredTiger 要求更改磁盘上的存储格式。有关将存储引擎更改为 WiredTiger 的说明,请参阅将 MongoDB 升级到 3.0文档中的相应部分。

MongoDB 3.0 副本集和分片集群可以使成员具有不同的存储引擎;但是,性能可能会因工作负载而异。有关详细信息,请参见将 MongoDB 升级到 3.0文档中的相应部分。

WiredTiger 存储引擎需要最新的官方 MongoDB 驱动程序。有关更多信息,请参见WiredTiger 和驱动程序版本兼容性

WiredTiger Configuration

要配置 WiredTiger 存储引擎的行为和属性,请参阅storage.wiredTiger配置选项。您可以设置命令行上的 WiredTiger 选项

WiredTiger 并发和压缩

3.0 WiredTiger 存储引擎提供文档级锁定和压缩。

默认情况下,WiredTiger 使用snappy压缩库压缩收集数据。默认情况下,WiredTiger 在所有索引上使用prefix compression

MMAPv1 Improvements

MMAPv1 并发改进

在 3.0 版中,MMAPv1 存储引擎添加了对集合级锁定的支持。

MMAPv1 配置更改

为了支持多个存储引擎,MMAPv1 的某些配置设置已更改。参见配置文件选项更改

MMAPv1 记录分配行为更改

MongoDB 3.0 不再实现动态记录分配并弃用paddingFactor。在使用 MMAPv1 的实例中,集合的默认分配策略是2 分配的力量,此策略已得到改进,可以更好地处理大型文档。在 3.0 中,usePowerOf2Sizes标志将被忽略,因此 2 策略的幂将用于所有未设置noPadding标志的集合。

对于工作负载仅包含插入或就地更新(例如递增计数器)的集合,可以禁用 2 策略的幂。要为集合禁用 2 的幂策略,请使用带有noPadding标志的collMod命令或带有noPadding选项的db.createCollection()方法。

Warning

如果工作负荷包括删除或任何可能导致文档增长的更新,请不要设置noPadding。有关更多信息,请参见无填充分配策略

当磁盘空间不足时,MongoDB 3.0 不再在所有写入操作中出错,而仅在所需的磁盘分配失败时才会出错。这样,MongoDB 现在允许就地更新并在磁盘空间不足时将其删除。

Replica Sets

副本集成员数增加

在 MongoDB 3.0 中,副本集最多可包含 50 个成员。 [1]以下驱动程序支持较大的副本集:

  • C#(.NET)驱动程序 1.10

  • Java 驱动程序 2.13

  • Python 驱动程式(PyMongo)3.0

  • Ruby 驱动程式 2.0

  • Node.JS 驱动程序 2.0

C,C,Perl 和旧版 PHP 驱动程序以及早期版本的 Ruby,Python 和 Node.JS 驱动程序会串行发现和监视副本集成员,因此不适合与大型副本集一起使用。

[1]投票成员的最大数量保持为 7.

副本集降级行为更改

replica setprimary成员下台的过程进行了以下更改:

  • 在降级之前,replSetStepDown将尝试终止长时间运行的用户操作,这些操作将阻止主数据库降级,例如索引构建,写操作或 Map 减少作业。

  • 为了帮助防止回滚,replSetStepDown将 await 可选的辅助节点赶上主要节点的状态,然后再退出。以前,主节点要等到辅助节点赶上主节点 10 秒以内(即复制延迟为 10 秒或更短的辅助节点)后才能退出。

  • replSetStepDown现在允许用户指定secondaryCatchUpPeriodSecs参数,以指定主节点在降级之前应 await 辅助节点追赶多长时间。

其他副本集的操作更改

  • 初始同步可以更有效地为每个集合构建索引,并使用线程批量应用操作日志条目。

  • w: "majority"写关注的定义已更改为意味着投票节点居多。

  • 副本集配置的限制更严格。有关详细信息,请参见副本集配置验证

  • 对于辅助成员上预先存在的集合,MongoDB 3.0 不再自动构建缺少的_id索引。

Sharded Clusters

MongoDB 3.0 对分片群集提供了以下增强功能:

Security Improvements

MongoDB 3.0 包括以下安全性增强功能:

  • MongoDB 3.0 添加了新的SCRAM-SHA-1质询响应用户身份验证机制。如果您当前的驱动程序版本不支持SCRAM-SHA-1,则SCRAM-SHA-1需要驱动程序升级。有关支持SCRAM-SHA-1的驱动程序版本,请参见Requirements

  • 使用Localhost Exception访问 MongoDB 时增加限制。有关详细信息,请参见Localhost 异常已更改

Improvements

新的查询自省系统

MongoDB 3.0 包括一个新的查询自检系统,该系统提供了改进的输出格式以及对查询计划和查询执行的更细粒度的自检。

有关详细信息,请参见新的db.collection.explain()方法和新的explain命令以及更新的cursor.explain()方法。

有关新输出格式的信息,请参见Explain Results

Enhanced Logging

为了提高用于诊断的日志消息的可用性,MongoDB 将某些日志消息归类为特定的组件或操作,并提供了为这些组件设置详细级别的功能。有关信息,请参阅Log Messages

MongoDB 工具增强功能

现在,除mongosniffmongoperf之外的所有 MongoDB 工具都用 Go 编写,并作为一个单独的项目进行维护。

  • 并行化mongodumpmongorestore的新选项。您可以使用--numParallelCollections选项控制mongorestore一次还原的集合的数量。

  • mongodump的新选项-excludeCollection--excludeCollectionsWithPrefix排除了集合。

  • mongorestore现在除了从文件中读取 BSON 数据外,还可以接受来自标准 Importing 的 BSON 数据 Importing。

  • mongostatmongotop现在可以使用--json选项以 JSON 格式返回输出。

  • mongoimportmongorestoremongofiles添加了可配置的write concern。使用--writeConcern选项。默认的 writeConcern 已更改为'w:majority'。

  • mongofiles现在允许您使用--prefix选项配置 GridFS 前缀,以便可以使用自定义名称空间并将多个 GridFS 名称空间存储在单个数据库中。

Indexes

  • 如果受索引构建影响的数据库或集合发生dropDatabasedropdropIndexes操作,则后台索引构建将不再自动中断。像 2.6 中一样,dropDatabasedropdropIndexes命令仍然会失败,并显示错误消息a background operation is currently running

  • 如果您为createIndexes命令指定了多个索引,

  • 该命令只扫描一次集合,并且

    • 如果要在前台构建至少一个索引,则该操作将在前台构建所有指定的索引。
  • 对于分片集合,如果索引包含分片键,则索引现在可以cover queriesmongos执行。

Query Enhancements

MongoDB 3.0 包括以下查询增强功能:

发行版和受支持的版本

现在,大多数非企业级 MongoDB 发行版都支持 TLS/SSL。以前,仅 MongoDB Enterprise 发行版附带 TLS/SSL 支持;对于非企业发行版,您必须使用--ssl标志(即scons --ssl)在本地构建 MongoDB。

32 位 MongoDB 构建可用于测试,但不可用于生产。 32 位 MongoDB 构建不包括 WiredTiger 存储引擎。

针对 Solaris 的 MongoDB 构建不支持 WiredTiger 存储引擎。

MongoDB 构建可用于 Windows Server 2003 和 Windows Vista(作为“ 64 位旧版”),但是官方最低支持的 Windows 版本是 Windows Server 2008.

Package Repositories

适用于 3.0 及更高版本的非企业级 MongoDB Linux 软件包位于新的存储库中。按照相应的Linux 安装说明从新位置安装 3.0 软件包。

MongoDB 企业功能

Auditing

MongoDB Enterprise 中的Auditing可以对审核消息中的任何字段进行过滤,包括param文档中返回的字段。此增强功能与auditAuthorizationSuccess参数一起,使审核能够筛选 CRUD 操作。但是,启用auditAuthorizationSuccess审核所有授权成功比单独审核授权失败更能降低性能。

Additional Information

影响兼容性的更改

3.0 中的某些更改可能会影响compatibility,并且可能需要用户采取措施。有关兼容性更改的详细列表,请参见MongoDB 3.0 中的兼容性更改

Upgrade Process

  • 将 MongoDB 升级到 3.0

  • 升级建议和清单

  • Upgrade Requirements

  • 将独立 mongod 实例升级到 MongoDB 3.0

  • Upgrade Binaries

  • 下载 3.0 二进制文件。

       - [Replace 2\.6 binaries\.](release-notes-3.0-upgrade.html#replace-2-6-binaries)
    
     - [Change Storage Engine for Standalone to WiredTiger](release-notes-3.0-upgrade.html#change-storage-engine-for-standalone-to-wiredtiger)
    
  • Prerequisites

     - [Upgrade Binaries](release-notes-3.0-upgrade.html#id1) 
    
  • 升级副本集的辅助成员。

       - [Step down the replica set primary\.](release-notes-3.0-upgrade.html#step-down-the-replica-set-primary)
    
       - [Upgrade the primary\.](release-notes-3.0-upgrade.html#upgrade-the-primary)
    
     - [Change Replica Set Storage Engine to WiredTiger](release-notes-3.0-upgrade.html#change-replica-set-storage-engine-to-wiredtiger)
    
  • Considerations

     - [Upgrade Sharded Clusters](release-notes-3.0-upgrade.html#upgrade-sharded-clusters) 
    
  • 禁用平衡器。

       - [Upgrade the cluster's meta data\.](release-notes-3.0-upgrade.html#upgrade-the-cluster-s-meta-data)
    
       - [Ensure mongos \-\-upgrade process completes successfully\.](release-notes-3.0-upgrade.html#ensure-mongos-upgrade-process-completes-successfully)
    
       - [Upgrade the remaining mongos instances to 3\.0\.](release-notes-3.0-upgrade.html#upgrade-the-remaining-mongos-instances-to-3-0)
    
       - [Upgrade the config servers\.](release-notes-3.0-upgrade.html#upgrade-the-config-servers)
    
       - [Upgrade the shards\.](release-notes-3.0-upgrade.html#upgrade-the-shards)
    
       - [Re\-enable the balancer\.](release-notes-3.0-upgrade.html#re-enable-the-balancer)
    
     - [Change Sharded Cluster Storage Engine to WiredTiger](release-notes-3.0-upgrade.html#change-sharded-cluster-storage-engine-to-wiredtiger)
    
  • 停止现有的 mongod 实例。

  • 升级到 SCRAM

  • Overview

  • 现有的 2.6 用户凭证

  • Backwards Incompatibility

  • 连接到 MongoDB 实例。

  • 运行 authSchemaUpgrade 命令。

     - [Sharded cluster authSchemaUpgrade consideration\.](release-notes-3.0-scram.html#sharded-cluster-authschemaupgrade-consideration)
    
  • 从 3.0 降级 MongoDB

  • 降级建议和清单

  • Downgrade Path

  • 降级独立 mongod 实例

  • 将存储引擎更改为 MMAPv1

  • 确保 3.0 mongod 与 WiredTiger 一起运行。

       - [Export the data using mongodump\.](release-notes-3.0-downgrade.html#export-the-data-using-mongodump)
    
       - [Create data directory for MMAPv1\.](release-notes-3.0-downgrade.html#create-data-directory-for-mmapv1)
    
       - [Restart the mongod with MMAPv1\.](release-notes-3.0-downgrade.html#restart-the-mongod-with-mmapv1)
    
       - [Upload the exported data using mongorestore\.](release-notes-3.0-downgrade.html#upload-the-exported-data-using-mongorestore)
    
     - [Downgrade Binaries](release-notes-3.0-downgrade.html#downgrade-binaries) 
    
  • 下载 2.6 二进制文件。

       - [Replace with 2\.6 binaries\.](release-notes-3.0-downgrade.html#replace-with-2-6-binaries)
    
  • 将存储引擎更改为 MMAPv1

  • 关闭辅助成员。

       - [Prepare data directory for MMAPv1\.](release-notes-3.0-downgrade.html#prepare-data-directory-for-mmapv1)
    
       - [Restart the secondary member with MMAPv1\.](release-notes-3.0-downgrade.html#restart-the-secondary-member-with-mmapv1)
    
     - [Downgrade Binaries](release-notes-3.0-downgrade.html#id2) 
    
  • 降级副本集的辅助成员。

       - [Step down the primary\.](release-notes-3.0-downgrade.html#step-down-the-primary)
    
       - [Replace and restart former primary mongod\.](release-notes-3.0-downgrade.html#replace-and-restart-former-primary-mongod)
    
  • Requirements

     - [Change Storage Engine to MMAPv1](release-notes-3.0-downgrade.html#id3) 
    
  • 更改分片以使用 MMAPv1

       - [Change Config Servers to Use MMAPv1](release-notes-3.0-downgrade.html#change-config-servers-to-use-mmapv1) 
    
  • 禁用平衡器。

         - [Stop the last config server listed in the mongos' configDB setting\.](release-notes-3.0-downgrade.html#stop-the-last-config-server-listed-in-the-mongos-configdb-setting)
    
         - [Export data of the second config server listed in the mongos' configDB setting\.](release-notes-3.0-downgrade.html#export-data-of-the-second-config-server-listed-in-the-mongos-configdb-setting)
    
         - [For the second config server, create a new data directory for MMAPv1\.](release-notes-3.0-downgrade.html#for-the-second-config-server-create-a-new-data-directory-for-mmapv1)
    
         - [Restart the second config server with MMAPv1\.](release-notes-3.0-downgrade.html#restart-the-second-config-server-with-mmapv1)
    
         - [Upload the exported data using mongorestore to the second config server\.](release-notes-3.0-downgrade.html#upload-the-exported-data-using-mongorestore-to-the-second-config-server)
    
         - [Shut down the second config server\.](release-notes-3.0-downgrade.html#shut-down-the-second-config-server)
    
         - [Restart the third config server\.](release-notes-3.0-downgrade.html#restart-the-third-config-server)
    
         - [Export data of the third config server\.](release-notes-3.0-downgrade.html#export-data-of-the-third-config-server)
    
         - [For the third config server, create a new data directory for MMAPv1\.](release-notes-3.0-downgrade.html#for-the-third-config-server-create-a-new-data-directory-for-mmapv1)
    
         - [Restart the third config server with MMAPv1\.](release-notes-3.0-downgrade.html#restart-the-third-config-server-with-mmapv1)
    
         - [Upload the exported data using mongorestore to the third config server\.](release-notes-3.0-downgrade.html#upload-the-exported-data-using-mongorestore-to-the-third-config-server)
    
         - [Export data of the first config server listed in the mongos' configDB setting\.](release-notes-3.0-downgrade.html#export-data-of-the-first-config-server-listed-in-the-mongos-configdb-setting)
    
         - [For the first config server, create data directory for MMAPv1\.](release-notes-3.0-downgrade.html#for-the-first-config-server-create-data-directory-for-mmapv1)
    
         - [Restart the first config server with MMAPv1\.](release-notes-3.0-downgrade.html#restart-the-first-config-server-with-mmapv1)
    
         - [Upload the exported data using mongorestore to the first config server\.](release-notes-3.0-downgrade.html#upload-the-exported-data-using-mongorestore-to-the-first-config-server)
    
         - [Enable writes to the sharded cluster's metadata\.](release-notes-3.0-downgrade.html#enable-writes-to-the-sharded-cluster-s-metadata)
    
         - [Re\-enable the balancer\.](release-notes-3.0-downgrade.html#re-enable-the-balancer)
    
     - [Downgrade Binaries](release-notes-3.0-downgrade.html#id4) 
    
  • 禁用平衡器。

       - [Downgrade each shard, one at a time\.](release-notes-3.0-downgrade.html#downgrade-each-shard-one-at-a-time)
    
       - [Downgrade the config servers\.](release-notes-3.0-downgrade.html#downgrade-the-config-servers)
    
       - [Downgrade the mongos instances\.](release-notes-3.0-downgrade.html#downgrade-the-mongos-instances)
    
       - [Re\-enable the balancer\.](release-notes-3.0-downgrade.html#id7)
    
  • 停止现有的 mongod 实例。

有关完整的升级说明,请参见将 MongoDB 升级到 3.0

Download

要下载 MongoDB 3.0,请转到downloads page