Upgrade a Standalone to 3.6

Note

  • MongoDB 3.6 is not tested on APFS, the new filesystem in macOS 10.13and 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.04POWER/PPC64LE:

Due to a lock elision bug present in older versionsof the glibc package on Ubuntu 16.04 for POWER, you mustupgrade the glibc package to at least glibc 2.23-0ubuntu5before running MongoDB. Systems with older versions of theglibc package will experience database server crashes andmisbehavior due to random memory corruption, and are unsuitablefor production deployments of MongoDB

The following steps outline the procedure to upgrade a standalonemongod from version 3.4 to 3.6.

Important

Before you attempt any upgrade, please familiarize yourself with thecontent of this document.

If you need guidance on upgrading to 3.6, MongoDB offers major versionupgrade services to help ensurea smooth transition without interruption to your MongoDB application.

Upgrade Recommendations and Checklists

When upgrading, consider the following:

Upgrade Version Path

To upgrade an existing MongoDB deployment to 3.6, you must berunning a 3.4-series release.

To upgrade from a version earlier than the 3.4-series, you mustsuccessively upgrade major releases until you have upgraded to3.4-series. For example, if you are running a 3.2-series, you mustupgrade first to 3.4before you can upgrade to 3.6.

Preparedness

Before beginning your upgrade, see the Compatibility Changes in MongoDB 3.6 document toensure that your applications and deployments are compatible withMongoDB 3.6. Resolve the incompatibilities in your deployment beforestarting the upgrade.

Before upgrading MongoDB, always test your application in a stagingenvironment before deploying the upgrade to your productionenvironment.

Downgrade Consideration

Once upgraded to 3.6, if you need to downgrade, we recommend downgrading to the latest patch release of 3.4.

Default Bind to Localhost

Starting in MongoDB 3.6, mongod and mongosinstances bind to localhost by default. Remote clients cannot connectto an instance bound only to localhost. To override and bind to otherip addresses, use the net.bindIp configuration file settingor the —bind_ip command-line option to specify a list of ipaddresses.

The upgrade process will require that you specify thenet.bindIp setting if you wish remote clients to connect toyour instance.

Warning

Before binding to a non-localhost (e.g. publicly accessible)IP address, ensure you have secured your cluster from unauthorizedaccess. For a complete list of security recommendations, seeSecurity Checklist. At minimum, considerenabling authentication andhardening network infrastructure.

For more information, see Localhost Binding Compatibility Changes.

Prerequisites

The 3.4 instance must have featureCompatibilityVersion setto 3.4. To check featureCompatibilityVersion:

  1. db.adminCommand( { getParameter: 1, featureCompatibilityVersion: 1 } )

The operation should return a result that includes"featureCompatibilityVersion": "3.4".

To set or update featureCompatibilityVersion, run the followingcommand:

  1. db.adminCommand( { setFeatureCompatibilityVersion: "3.4" } )

For more information, see setFeatureCompatibilityVersion.

Download 3.6 Binaries

Via Package Manager

If you installed MongoDB from the MongoDB apt, yum, dnf, orzypper repositories, you should upgrade to 3.6 using your packagemanager.

Follow the appropriate 3.6 installation instructions for your Linux system. Thiswill involve adding a repository for the new release, then performingthe actual upgrade process.

Manually

If you have not installed MongoDB using a package manager, you canmanually download the MongoDB binaries from the MongoDB DownloadCenter.

See 3.6 installation instructions for more information.

Upgrade Process

Replace existing 3.4 binaries with the 3.6 binaries.

Shut down your mongod instance. Replace the existingbinary with the 3.6 mongod binary.

Restart mongod. If you wish remote clients to connect tothe mongod instance, you must specify —bind_ip (orthe net.bindIp setting). For more information, seeLocalhost Binding Compatibility Changes.

Enable backwards-incompatible 3.6 features.

At this point, you can run the 3.6 binaries without the3.6 features that are incompatible with 3.4.

To enable these 3.6 features, set the feature compatibilityversion (FCV) to 3.6.

Tip

Enabling these backwards-incompatible features can complicate thedowngrade process since you must remove any persistedbackwards-incompatible features before you downgrade.

It is recommended that after upgrading, you allow your deployment torun without enabling these features for a burn-in period to ensurethe likelihood of downgrade is minimal. When you are confident thatthe likelihood of downgrade is minimal, enable these features.

Run the setFeatureCompatibilityVersion command against the admin database:

  1. db.adminCommand( { setFeatureCompatibilityVersion: "3.6" } )

This command must perform writes to an internal systemcollection. If for any reason the command does not completesuccessfully, you can safely retry the command asthe operation is idempotent.

Additional Upgrade Procedures