How to migrate mongoDB storage engine from MMAPv1 to WiredTiger in Satellite 6.5 or later?

Solution Verified - Updated

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.

For Satellite 6.7.1 or older, apply further these steps:

  • To prevent future runs of satellite-installer to refer to MMAPv1-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:

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"
    
SBR
Product(s)
Components
Category

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.