Upgrade to MongoDB Enterprise (Sharded Cluster)
On this page本页内容
MongoDB Enterprise provides various features not available in the MongoDB Community edition, such as:
- In-Memory Storage Engine
- Auditing
- Kerberos Authentication
- LDAP Proxy Authentication and LDAP Authorization
- Encryption at Rest
The following steps outline the procedure to upgrade a sharded cluster 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.
Consideration
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 7.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.
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.
Disable the Balancer.
Connect mongosh
to a mongos
instance in the sharded cluster, and run sh.stopBalancer()
to disable the balancer:
sh.stopBalancer()
If a migration is in progress, the system will complete the in-progress migration before stopping the balancer. You can run sh.isBalancerRunning()
to check the balancer's current state.
To verify that the balancer is disabled, run sh.getBalancerState()
, which returns false if the balancer is disabled:
sh.getBalancerState()
Starting in MongoDB 6.1, automatic chunk splitting is not performed. This is because of balancing policy improvements. Auto-splitting commands still exist, but do not perform an operation. For details, see Balancing Policy Changes.
In MongoDB versions earlier than 6.1, sh.stopBalancer()
also disables auto-splitting for the sharded cluster.
For more information on disabling the balancer, see Disable the Balancer.
Upgrade the config servers.
- Upgrade the secondary members of the replica set one at a time:
- Shut down the secondary
mongod
instance. - Restart the member with the Enterprise
mongod
, specifying the same configuration options (e.g. same data directory, configuration file, etc.). - Wait for the member to recover to
SECONDARY
state before upgrading the next secondary member. To check the member's state, issuers.status()
inmongosh
.
Repeat for each remaining secondary member.
- Shut down the secondary
- Step down the replica set primary.
Connect
mongosh
to the primary and users.stepDown()
to step down the primary and force an election of a new primary:rs.stepDown()
- When
rs.status()
shows that the primary has stepped down and another member is primary, upgrade the stepped-down primary:- Shut down the stepped-down primary.
- Restart with the Enterprise
mongod
, specifying the same configuration options (e.g. same data directory, configuration file, etc.).
Upgrade the shards.
Upgrade the shards one at a time.
For each shard replica set:
- Upgrade the secondary members of the replica set one at a time:
- Shut down the secondary
mongod
instance. - Restart the member with the Enterprise
mongod
, specifying the same configuration options (e.g. same data directory, configuration file, etc.). - Wait for the member to recover to
SECONDARY
state before upgrading the next secondary member. To check the member's state, issuers.status()
inmongosh
.
Repeat for each remaining secondary member.
- Shut down the secondary
- Step down the replica set primary.
Connect
mongosh
to the primary and users.stepDown()
to step down the primary and force an election of a new primary:rs.stepDown()
- When
rs.status()
shows that the primary has stepped down and another member is primary, upgrade the stepped-down primary:- Shut down the stepped-down primary.
- Restart with the Enterprise
mongod
, specifying the same configuration options (e.g. same data directory, configuration file, etc.).
Re-enable the balancer.
Using mongosh
, connect to a mongos
in the cluster and run sh.startBalancer()
to re-enable the balancer:
sh.startBalancer()
Starting in MongoDB 6.1, automatic chunk splitting is not performed. This is because of balancing policy improvements. Auto-splitting commands still exist, but do not perform an operation. For details, see Balancing Policy Changes.
In MongoDB versions earlier than 6.1, sh.startBalancer()
also enables auto-splitting for the sharded cluster.
For more inforamtion on the balancer, see Enable the Balancer.
Before using any Enterprise features, ensure that all members have been upgraded to Enterprise edition.