How to migrate mongoDB storage engine from MMAPv1 to WiredTiger in Satellite 6.5 or later?
Environment
- Red Hat Satellite 6.5 and later
Issue
- How to use WiredTiger as the MongoDB storage engine?
- Is it possible to migrate MongoDB storage engine from mmapv1 to WiredTiger?
- What storage engine is used by MongoDB in Satellite 6?
Resolution
It is strongly advised to backup MongoDB before this procedure, esp. on pre-6.7 releases. There are specific scenarios that might lead to empty DB so an extra backup is worth to have.
- Follow steps in this 6.7 documentation, even on older Satellite
For Satellite 6.7.1 or older, apply further these steps:
-
To prevent future runs of
satellite-installerto refer toMMAPv1-engine remove the following line
in /etc/foreman-installer/custom-hiera.yaml:mongodb::server::storage_engine: 'mmapv1' -
After completed, it is recommended that you perform the tuning outlined in the following document to ensure proper memory consumption with the WiredTiger engine:
- Additional information:
- Note that Satellite 6.4 and Satellite 6.5 get WiredTiger storage engine by default on new installations.
- Currently, the upgrade of storage engine to WiredTiger is supported only on Satellite 6.5. This capability for 6.4 will be available when This content is not included.Bugzilla 1715227 is fixed.
- Also, This content is not included.RFE BZ 1727926 has been filed to change the directory instead of /var/tmp.
For more KB articles/solutions related to Red Hat Satellite 6.x MongoDB Issues, please refer to the Consolidated Troubleshooting Article for Red Hat Satellite 6.x MongoDB-related Issues
Root Cause
The main reasons for using WiredTiger in favour of mmap1 are the following:
- better locking mechanism that applies more locally, causing concurrent requests to wait less time
- mongodb scales better when adding more CPUs
- smaller disk size is expected
Diagnostic Steps
-
How to check storage engine from the command line?
mongo pulp_database --eval "db.serverStatus().storageEngine" -
It returns the storage engine being used currently, For example:
"name" : "wiredTiger"
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.