Upgrade a Sharded Cluster to 3.6
On this page
MongoDB 3.6 is not tested on APFS, the new filesystem in macOS 10.13 and may encounter errors.
Starting in MongoDB 3.6.13, MongoDB 3.6-series removes support for Ubuntu 16.04 PPCLE.
For earlier MongODB Enterprise versions that support Ubuntu 16.04 POWER/PPC64LE:
Due to a lock elision bug present in older versions of the
glibcpackage on Ubuntu 16.04 for POWER, you must upgrade the
glibcpackage to at least
glibc 2.23-0ubuntu5before running MongoDB. Systems with older versions of the
glibcpackage will experience database server crashes and misbehavior due to random memory corruption, and are unsuitable for production deployments of MongoDB
Before you attempt any upgrade, please familiarize yourself with the content of this document.
If you need guidance on upgrading to 3.6, MongoDB offers major version upgrade services to help ensure a smooth transition without interruption to your MongoDB application.
When upgrading, consider the following:
To upgrade an existing MongoDB deployment to 3.6, you must be running a 3.4-series release.
To upgrade from a version earlier than the 3.4-series, you must successively upgrade major releases until you have upgraded to 3.4-series. For example, if you are running a 3.2-series, you must upgrade first to 3.4 before you can upgrade to 3.6.
Before beginning your upgrade, see the Compatibility Changes in MongoDB 3.6 document to ensure that your applications and deployments are compatible with MongoDB 3.6. Resolve the incompatibilities in your deployment before starting the upgrade.
Before upgrading MongoDB, always test your application in a staging environment before deploying the upgrade to your production environment.
Once upgraded to 3.6, if you need to downgrade, we recommend downgrading to the latest patch release of 3.4.
Starting in MongoDB 3.6,
mongos instances bind to localhost by default. Remote clients, including other members of the replica set, cannot connect to an instance bound only to localhost. To override and bind to other ip addresses, use the
net.bindIp configuration file setting or the
--bind_ip command-line option to specify a list of ip addresses.
The upgrade process will require that you specify the
net.bindIp setting (or
--bind_ip) if your sharded cluster members are run on different hosts or if you wish remote clients to connect to your sharded cluster.
Before binding to a non-localhost (e.g. publicly accessible) IP address, ensure you have secured your cluster from unauthorized access. For a complete list of security recommendations, see Security Checklist. At minimum, consider enabling authentication and hardening network infrastructure.
For more information, see Localhost Binding Compatibility Changes
For MongoDB 3.6.0 - 3.6.3 binaries, you should upgrade your drivers to 3.6 feature compatible drivers only after you have upgraded the MongoDB binaries and updated the feature compatibility version of the sharded cluster to 3.6.
For more information, see SERVER-33763 .
Starting in MongoDB 3.6, MongoDB enables support for
"majority" read concern by default.
For MongoDB 3.6.1 - 3.6.x, however, you can disable read concern
"majority" to prevent the storage cache pressure from immobilizing a deployment with a primary-secondary-arbiter (PSA) architecture. Disabling
"majority" read concern also disables support for Change Streams
For more information, see Disable Read Concern Majority.
- Version 3.4 or Greater
To upgrade a sharded cluster to 3.6, all members of the cluster must be at least version 3.4. The upgrade process checks all components of the cluster and will produce warnings if any component is running version earlier than 3.4.
- Feature Compatibility Version
The 3.4 sharded cluster must have
To ensure that all members of the sharded cluster have
3.4, connect to each shard replica set member and each config server replica set member and check the
For a sharded cluster that has access control enabled, to run the following command against a shard replica set member, you must connect to the member as a shard local user.
All members should return a result that includes
To set or update
featureCompatibilityVersion, run the following command on the
For more information, see
- Shard Aware
The shards in the 3.4 sharded clusters must be shard aware (i.e. the shards must have received their
shardIdentitydocument, located in the
For sharded clusters that started as 3.4, the shards are shard aware.
For 3.4 sharded clusters that were upgraded from 3.2-series, when you update
3.4, the config server attempts to send the shards their respective
shardIdentitydocument every 30 seconds until success. You must wait until all shards receive the documents.
To check whether a shard replica set member has received its
shardIdentitydocument, issue the
findcommand against the
system.versioncollection in the
admindatabase and check for a document where
"_id" : "shardIdentity".
For an example of a
Back up the
Optional but Recommended. As a precaution, take a backup of the
configdatabase before upgrading the sharded cluster.
- Back up the
If you installed MongoDB from the MongoDB
zypper repositories, you should upgrade to 3.6 using your package manager.
Follow the appropriate 3.6 installation instructions for your Linux system. This will involve adding a repository for the new release, then performing the actual upgrade process.
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:
For more information on disabling the balancer, see Disable the Balancer.