Install DMK for MongoDB

Install and configure DMK for MongoDB

This document will use the directory structure described in MongoDB directory structure (OFA).

Download DMK

From AWS S3

See Configure_AWS_S3.md for how to configure S3 to download DMK for MongoDB.

From Nexus

https://packages.dbi-services.com/

Install DMK

Commands are executed as the mongodb user.

Decompress the DMK_MongoDB package:

mongodb $ cd /u01/app/mongodb/artifacts
mongodb $ tar -xvzf MongoDB-DMK-xx-xx.tar.gz -C /u01/app/mongodb/local/
mongodb $ ls /u01/app/mongodb/local
drwxrwxr-x 9 mongodb mongodb 4096 Jan 14 09:04 dmk

Note:

/u01/app/mongodb/local/ is the default installation directory for DMK, but it can be installed everywhere.

DMK configuration

Execute DMK for the first time

mongodb@dev-vm:/home/mongodb/ $ /u01/app/mongodb/local/dmk/bin/dmk.sh
2025-01-14_09:45:01::dmk.sh::/u01/app/mongodb/local/dmk/bin/dmk.sh ::INFO ==> DMK init environnement.
2025-01-14_09:45:01::dmk.sh::/u01/app/mongodb/local/dmk/bin/dmk.sh ::INFO ==> Add DMK_HOME=/u01/app/mongodb/local/dmk to /home/mongodb/.DMK
2025-01-14_09:45:01::dmk.sh::/u01/app/mongodb/local/dmk/bin/dmk.sh ::INFO ==> Add PERL5LIB= to /home/mongodb/.DMK
2025-01-14_09:45:01::dmk.sh::/u01/app/mongodb/local/dmk/bin/dmk.sh ::INFO ==> Add PERL_EXEC=/usr/bin/perl to /home/mongodb/.DMK
2025-01-14_09:45:01::dmk.sh::/u01/app/mongodb/local/dmk/bin/dmk.sh ::INFO ==> Add /u01/app/mongodb/local/dmk/templates/profile/dmk.mongodb.profile content to .profile or .bash_profile

🟡 NOTE:

  • It is recommended to add the content of /u01/app/mongodb/local/dmk/templates/profile/dmk.mongodb.profile to the .profile or .bash_profile file of the mongodb user. This step is optional but recommended, in order to have DMK environment set each time you log in.

mongodb $ sed -n '/# BEGIN DMK BLOCK/, /# END DMK BLOCK/p' /u01/app/mongodb/local/dmk/templates/profile/dmk.mongodb.profile >> $HOME/.bash_profile
  • At this stage, a default dmk.conf conf file was copied to /u01/app/mongodb/local/dmk/etc/dmk.conf. You can edit the DEFAULT section to adapt it at your configuration. The default dmk.conf is adapted to MFA directory structure.

🟡 NOTE: The only values that are mandatory to verify are:

Variable
Default Value

MONGODB_BASE

/u01/app/mongodb

MONGODB_LOG

/u02/mongodblog

MONGODB_BACKUP

/u90/backup

After completing these configuration steps, reload the bash environnement (exit and log in again). The prompt should look like this:

mongodb@{your_hostname}:/home/mongodb/ [DUMMY]

Last updated