Updating DMK
Updating DMK from a previous release.
Starting with release 2.3.0, DMK for MongoDB uses Python 3.6 or later instead of Perl. Follow these steps to upgrade to the latest 2.3.0 release.
As mongodb
user:
Prepare ~/.DMK
environment file with $DMK_HOME
and Python binary location
~/.DMK
environment file with $DMK_HOME
and Python binary locationBackup the current environment file, and create a new one:
mongodb@vm00:/home/mongodb/ [DUMMY] mv ~/.DMK ~/.DMK_old
mongodb@vm00:/home/mongodb/ [DUMMY] echo "export DMK_HOME=${DMK_HOME}" >> ~/.DMK
mongodb@vm00:/home/mongodb/ [DUMMY] echo "export PYTHON_BIN=$(which python3)" >> ~/.DMK
Move the former DMK folder, and unzip the new DMK.
Rename the old folder to a hidden one so it won’t be registered as an active module.
mongodb@vm00:/home/mongodb/ [DUMMY] cd /u01/app/mongodb/local/
mongodb@vm00:/u01/app/mongodb/local/ [DUMMY] ls -l
drwxrwx---. 10 mongodb mongodb 118 Jul 1 04:34 dmk
mongodb@vm00:/u01/app/mongodb/local/ [DUMMY] mv dmk .dmk_old
mongodb@vm00:/u01/app/mongodb/local/ [DUMMY] unzip /u01/app/mongodb/artifacts/dmk_mongodb-2.3.0.zip
mongodb@vm00:/u01/app/mongodb/local/ [DUMMY] ls -ail
100690250 drwxrwx---. 8 mongodb mongodb 96 Jul 1 04:24 dmk
33554663 drwxrwx---. 10 mongodb mongodb 118 Jul 1 04:34 .dmk_old
Update .bash_profile
.bash_profile
The .bash_profile
must be updated. Copy it from the new version to ensure proper configuration, and merge any existing customizations.
mongodb@vm00:/home/mongodb/ [DUMMY] mv ~/.bash_profile ~/.bash_profile_old
mongodb@vm00:/home/mongodb/ [DUMMY] cp -p /u01/app/mongodb/local/dmk/templates/profile/dmk.mongodb.profile ~/.bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
umask 022
# BEGIN DMK BLOCK
if [ -z "$DMK_HOME" ]; then
if [ -f "$HOME/.DMK" ]; then
. "$HOME/.DMK"
else
echo "$HOME/.DMK file does not exist"
return 1
fi
fi
# Launched at login
. ${DMK_HOME}/bin/dmk.sh && ${PYTHON_BIN} ${DMK_HOME}/bin/dmk_status.py --table --all
# END DMK BLOCK
Log back into the mongodb
user to load the new environment
mongodb
user to load the new environmentTo finalize the update process, log back into the mongodb
user:
[root@vm00 ~]# su - mongodb
Last login: Tue Jul 1 05:29:45 EDT 2025 on pts/0
2025-07-01 05:31:24 | INFO | Default configuration file '/u01/app/mongodb/local/dmk/etc/dmk.conf.default' does not exist. Creating it.
2025-07-01 05:31:24 | INFO | Copying template file '/u01/app/mongodb/local/dmk/templates/etc/dmk.conf.unix' to '/u01/app/mongodb/local/dmk/etc/dmk.conf.default'
2025-07-01 05:31:24 | INFO | Local configuration file does not exist. Creating it.
2025-07-01 05:31:24 | INFO | Copying template file '/u01/app/mongodb/local/dmk/templates/etc/dmk.conf.local.template' to '/home/mongodb/.dmk/dmk.conf.local'
Instance State Version Port Bind IPs
----------------------------------------------------------------------
mdb01 STOPPED 8.0.11 25101 0.0.0.0
Customize DMK
If you had custom settings in your previous dmk.conf
file, copy them into the new ~/.dmk/dmk.conf.local
file. Specifically, check the five mandatory environment variables listed below.
$MONGO_BASE
/u01/app/mongodb
Binary files, instances configuration.
$MONGO_DATA_ROOT
/u02/mongodb/data/
MongoDB data files.
$MONGO_JOURNAL_ROOT
/u03/mongodb/journal/
MongoDB journal files. If you don't want to separate MongoDB journal and data files, set MONGO_JOURNAL_ROOT
to the same value as MONGO_DATA_ROOT
.
$MONGO_LOG_ROOT
/u04/mongodb/log/
MongoDB instances log files. Default changed in release 2.3.0 from /u02/mongodblog
to /u04/mongodb/log
, to separate data and log files.
$MONGO_BACKUP_ROOT
/u90/mongodb/backup
MongoDB backups location.
You have successfully updated DMK to the newest release.
Last updated