Database Manual / Self-Managed Deployments / Installation / Upgrade Community to Enterprise

Upgrade to MongoDB Enterprise (Replica Set)升级到MongoDB企业版(副本集)

Warning

MongoDB 8.3 Not Yet AvailableMongoDB 8.3尚未推出

MongoDB 8.3 release candidates are not yet available. This version of the manual is for an upcoming release and is currently a work in progress.MongoDB 8.3候选版本尚未发布。此版本的手册适用于即将发布的版本,目前正在进行中。

Important

MongoDB 8.3 is the latest minor release. Starting with MongoDB 8.2, minor releases are available for on-premises deployments (Community and EA) for specific use cases. MongoDB 8.3是最新的次要版本。从MongoDB 8.2开始,次要版本可用于特定用例的本地部署(社区和EA)。For more information, see MongoDB Versioning.有关更多信息,请参阅MongoDB版本控制

To install the latest MongoDB version supported for on-premises use, see the installation instructions.要安装支持本地使用的最新MongoDB版本,请参阅安装说明

MongoDB Enterprise provides various features not available in the MongoDB Community edition, such as:MongoDB Enterprise提供了MongoDB社区版中没有的各种功能,例如:

The following steps outline the procedure to upgrade a replica set from the MongoDB Community Edition to the MongoDB Enterprise Edition. For example, the steps can be used to upgrade MongoDB 7.0 Community to MongoDB 7.0 Enterprise.以下步骤概述了将副本集从MongoDB社区版升级到MongoDB企业版的过程。例如,这些步骤可用于将MongoDB 7.0社区升级到MongoDB 7.0企业版。

aConsideration考虑

Warning

Do not use these instructions to upgrade to another release version. 不要使用这些说明升级到其他版本。To upgrade release versions, refer to the appropriate release upgrade instructions, such as Upgrade to MongoDB 8.0.要升级发布版本,请参阅相应的发布升级说明,例如升级到MongoDB 8.0

Download Enterprise Binaries下载企业二进制文件

Depending on your operating system, you can install the MongoDB Enterprise binaries by using a package manager or by downloading the binaries manually.根据操作系统,您可以使用包管理器或手动下载二进制文件来安装MongoDB Enterprise二进制文件。

Linux(Package Manager)

If you have installed MongoDB Community using a package manager, follow the package manager instructions for your operating system:如果您使用包管理器安装了MongoDB Community,请按照操作系统的包管理器说明进行操作:

During the installation, the package manager will remove the community packages; this will not affect the running deployment until you restart.在安装过程中,包管理器将删除社区包;在您重新启动之前,这不会影响正在运行的部署。

Linux(Manual Download)

If you have not installed MongoDB using a package manager, you can manually download the MongoDB binaries from the MongoDB Download Center. 如果你没有使用包管理器安装MongoDB,你可以从MongoDB下载中心手动下载MongoDB二进制文件。Follow the manual instructions, including specific prerequisites for MongoDB Enterprise, for your operating system:遵循适用于操作系统的手册说明,包括MongoDB Enterprise的特定先决条件:

Important

Install to a location different from that of your current Community edition.安装到与当前社区版本不同的位置。

In the upgrade procedure, you will use the existing data directory and, if applicable, the existing configuration file.在升级过程中,您将使用现有的数据目录,并在适用的情况下使用现有的配置文件。

Windows

Important

You cannot use the .msi to install the Enterprise edition if you have the Community edition of the same release series installed on the same machine. 如果在同一台计算机上安装了相同版本系列的社区版,则无法使用msi安装企业版。That is, if you have version 4.4.0 Community edition installed, you cannot use the .msi to install the 4.4.0 or 4.4.1 Enterprise edition.也就是说,如果您安装了4.4.0社区版,则无法使用.msi安装4.4.0或4.4.1企业版。

  1. Manually download the archive file from the MongoDB Download Center.MongoDB下载中心手动下载存档文件。
  2. To install, extract/unzip the file to a location different from that of your current Community edition.要安装,请将文件解压缩到与当前社区版本不同的位置。

    In the upgrade procedure, you will use the existing data directory and, if applicable, the existing configuration file.在升级过程中,您将使用现有的数据目录,并在适用的情况下使用现有的配置文件。

macOS

Install the binaries:安装二进制文件:

  1. Manually download the archive file from the MongoDB Download Center.MongoDB下载中心手动下载存档文件。
  2. Extract the files to a location different from that of your current Community edition. For details on extracting the files, see macOS.将文件解压缩到与当前社区版本不同的位置。有关提取文件的详细信息,请参阅macOS。

    In the upgrade procedure, you will use the existing data directory and, if applicable, the existing configuration file.在升级过程中,您将使用现有的数据目录,并在适用的情况下使用现有的配置文件。

Procedure过程

To minimize downtime, you can upgrade from MongoDB Community to Enterprise Edition using a "rolling" upgrade by upgrading the members individually while the other members are available.为了尽量减少停机时间,您可以使用“滚动”升级从MongoDB社区升级到企业版,方法是在其他成员可用的情况下单独升级成员。

1

Upgrade secondary members of the replica set.升级副本集的辅助成员。

Upgrade the secondary members of the replica set one at a time:一次升级一个副本集的辅助成员:

  1. Shut down the mongod instance.关闭mongod实例。
  2. Restart with the Enterprise mongod, specifying the same configuration options (e.g. same data directory, configuration file, etc.).使用Enterprise mongod重新启动,指定相同的配置选项(例如,相同的数据目录、配置文件等)。

Wait for the member to recover to SECONDARY state before upgrading the next secondary member.在升级下一个SECONDARY成员之前,请等待成员恢复到SECONDARY状态。

2

Step down the replica set primary.逐步关闭主副本集。

Once all the secondary members have been upgraded to Enterprise, connect mongosh to the primary and use rs.stepDown() to step down the primary and force an election of a new primary.一旦所有次要成员都升级到Enterprise,将mongosh连接到主要成员,并使用rs.stepDown()退出主要成员并强制选举新的主要成员。

3

Upgrade the primary.升级主服务器。

When rs.status() shows that the primary has stepped down and another member has assumed PRIMARY state, upgrade the stepped-down primary:rs.status()显示主服务器已降级,另一个成员已处于primary状态时,升级降级的主服务器:

  1. Shut down the stepped-down primary.关闭已降级的小学。
  2. Restart with the Enterprise mongod, specifying the same configuration options (e.g. same data directory, configuration file, etc.).使用Enterprise mongod重新启动,指定相同的配置选项(例如,相同的数据目录、配置文件等)。

Important

Before using any Enterprise features, ensure that all members have been upgraded to Enterprise edition.在使用任何企业版功能之前,请确保所有成员都已升级到企业版。