Migrating from MongoDB 3.2 (RHSCL-2.2) to MongoDB 3.4 (RHSCL-3.0)
MongoDB is a high-performance, open source, schema-free document-oriented database. Red Hat Software Collections (RHSCL) 2.2 contains version 3.2 of MongoDB in the rh-mongodb32 Software Collection. RHSCL 3.0 includes MongoDB 3.4 provided by the rh-mongodb34 Collection. See these notes before upgrading to rh-mongodb34.
General Changes
The rh-mongodb34 Software Collection introduces several general changes listed below.
MongoDBintroduces support for the aarch64, ppc64le, and s390x architectures. TheWiredTigerstorage engine is supported on all these platforms.MongoDBintroduces the Content from docs.mongodb.com is not included.setFeatureCompatibilityVersioncommand, which enables or disablesMongoDB 3.4features that persist data that are backwards incompatible withMongoDB 3.2(these backward-incompatible features are enabled by default for newMongoDB 3.4deployments)mongosniffis replaced bymongoreplay, which offers a more flexible superset ofmongosniff‘s functionalityMongoDBadds Content from docs.mongodb.com is not included.compression support for messages for internal communication between members of a replica set or a sharded cluster as well as communication between themongoshell andmongodormongosMongoDB 3.4introduces Content from docs.mongodb.com is not included.zones, which supersedes tag-aware sharding available in earlier versions
Compatibility Changes
MongoDB 3.4 includes various minor changes that can affect compatibility with previous versions of MongoDB.
mongodinstances for the shards must explicitly specify its role as ashardsvr- Version 3.4
mongosinstances cannot connect to earlier versions ofmongodinstances - Sharded clusters no longer support the use of mirrored (SCCC)
mongodinstances as config servers - Deprecated operations (
groupandaggregate without cursor) - Stricter validation of collection and index specifications
- Privileges of the following built-in roles no longer apply to the
localandconfigdatabases:readAnyDatabase,readWriteAnyDatabase,userAdminAnyDatabase,dbAdminAnyDatabase. Correspondingly, theclusterManager,clusterMonitor,backup,restoreroles include read and write privileges onlocalandconfigdatabases. - If a collection is renamed on the sync source while an initial sync is running, the initial sync process fails and restarts to avoid possible data corruption
For detailed compatibility changes in MongoDB 3.4, see the Content from docs.mongodb.com is not included.upstream release notes.
Backwards incompatible features
The following MongoDB 3.4 features are backwards incompatible and require that the version is set to 3.4 using the featureCompatibilityVersion command:
- Support for creating read-only views from existing collections or other views
- Index version
v: 2, which adds support for collation, decimal data and case-insensitive indexes - Support for the
decimal128format with the newdecimaldata type
For details regarding backward incompatible changes in MongoDB 3.4, see the Content from docs.mongodb.com is not included.upstream release notes.
Upgrading from the rh-mongodb32 to the rh-mongodb34 Software Collection
Note that once you have upgraded to MongoDB 3.4, you cannot downgrade to version 3.2.7 or earlier. You can only downgrade to version 3.2.8 or later.
Important
Before migrating from therh-mongodb32to therh-mongodb34Software Collection, back up all your data, including anyMongoDBdatabases, which are by default stored in the/var/opt/rh/rh-mongodb32/lib/mongodb/directory. In addition, see the compatibility changes to ensure that your applications and deployments are compatible withMongoDB 3.4.
To upgrade to the rh-mongodb34 Software Collection, perform the following steps.
-
Install the
MongoDBservers and shells from therh-mongodb34Software Collection:~]# yum install rh-mongodb34 -
Stop the
MongoDB 3.2server:~]# systemctl stop rh-mongodb32-mongod.serviceUse the
service rh-mongodb32-mongodb stopcommand on a Red Hat Enterprise Linux 6 system. -
Copy your data to the new location:
~]# cp -a /var/opt/rh/rh-mongodb32/lib/mongodb/* /var/opt/rh/rh-mongodb34/lib/mongodb/ -
Configure the
rh-mongodb34-mongoddaemon in the/etc/opt/rh/rh-mongodb34/mongod.conffile. -
Start the
MongoDB 3.4server.~]# systemctl start rh-mongodb34-mongod.serviceOn Red Hat Enterprise Linux 6, use the
service rh-mongodb34-mongodb startcommand instead. -
Enable backwards-incompatible features:
~]$ scl enable rh-mongodb34 'mongo --host localhost --port 27017 admin' --eval 'db.adminCommand( { setFeatureCompatibilityVersion: "3.4" } )'If the
mongodserver is configured with enabled access control, add the--usernameand--passwordoptions tomongocommand.
Recommendation
It is recommended that after upgrading, you allow your deployment to run without enabling these features for a burn-in period to ensure the likelihood of a downgrade is minimal.
For detailed information about upgrading, see the upstream Content from docs.mongodb.com is not included.MongoDB 3.4 release notes.
For information about upgrading a Replica Set, see the upstream Content from docs.mongodb.com is not included.MongoDB Manual.
For information about upgrading a Sharded Cluster, see the upstream Content from docs.mongodb.com is not included.MongoDB Manual.