Install DMK for MongoDB

Install and configure dmk for mongodb

See MongoDB_MFA.md for the reccomended directory structure. This document will use the directory structure as described in this document.

Download DMK_MONGODB

From AWS s3

See Configure_AWS_S3.md for how to configure S3. or

From Nexus

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

Commands are executed as mongodb user.

Decompress 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 directory where DMK is installed usually. But it can be 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 mongodb user. This step is optional but recommended, in order to have DMK environment set to each login.

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 level 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 look are:

Variable
Default Value

MONGODB_BASE

/u01/app/mongodb

MONGODB_LOG

/u02/mongodblog

MONGODB_BACKUP

/u90/backup

After these configuration steps, resource the bash environnement (exit and login again). The prompt should look like this:

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

Last updated