This DMK template contains the following arguments :
instance_name: Name of the instance, which must comply with the INSTANCE_NAMING_CONVENTION defined in the DMK configuration file. By default, it is set to ^mdb([a-zA-Z]{0,4})(\d+)$, but you can customize it in your local configuration file.
home_path: Path to the MongoDB binaries associated with the instance. This path is stored in the $DMK_HOME/etc/mongodb.lst file and used when loading the environment for the instance.
data_path: Directory where the data files will be stored. Defaults to $MONGO_DATA_ROOT.
mongodb@vm00: dmk_dbcreate.py -c /u01/app/mongodb/local/dmk/templates/dbcreate/dbcreate_template_basic.yaml
2025-06-30 02:08:41 | INFO | Creating new MongoDB instance using configuration file: 'dbcreate_template_basic.yaml'
2025-06-30 02:08:41 | WARNING | bindIp is set to 0.0.0.0, which might cause issues with TLS and could represent a security risk.
2025-06-30 02:08:41 | INFO | Creating directory layout for mdb01 ...
2025-06-30 02:08:41 | INFO | Directory '/u02/mongodb/data/mdb01' created.
2025-06-30 02:08:41 | INFO | Directory '/u01/app/mongodb/admin/mdb01' created.
2025-06-30 02:08:41 | INFO | Directory '/u04/mongodb/log/mdb01' created.
2025-06-30 02:08:41 | INFO | Directory '/u90/mongodb/backup/mdb01' created.
2025-06-30 02:08:41 | INFO | Directory '/u01/app/mongodb/admin/mdb01/pid' created.
2025-06-30 02:08:41 | INFO | Directory '/u01/app/mongodb/admin/mdb01/etc' created.
2025-06-30 02:08:41 | INFO | Directory '/u01/app/mongodb/admin/mdb01/dump' created.
2025-06-30 02:08:41 | INFO | Directory '/u01/app/mongodb/admin/mdb01/secret' created.
2025-06-30 02:08:41 | INFO | Directory '/u03/mongodb/journal/mdb01' created.
2025-06-30 02:08:41 | INFO | Created symlink: /u01/app/mongodb/admin/mdb01/backup -> /u90/mongodb/backup/mdb01
2025-06-30 02:08:41 | INFO | Created symlink: /u01/app/mongodb/admin/mdb01/log -> /u04/mongodb/log/mdb01
2025-06-30 02:08:41 | INFO | Created symlink: /u02/mongodb/data/mdb01/journal -> /u03/mongodb/journal/mdb01
2025-06-30 02:08:41 | INFO | Creating MongoDB configuration file from template: /u01/app/mongodb/local/dmk/templates/dbcreate/mongo_conf_basic.yaml
2025-06-30 02:08:41 | INFO | Created MongoDB configuration file at '/u01/app/mongodb/admin/mdb01/etc/mdb01.conf'
2025-06-30 02:08:41 | INFO | Creating systemd file from template at '/u01/app/mongodb/local/dmk/templates/systemd/mongod.service.template'
2025-06-30 02:08:41 | WARNING | Created service file for systemd at '/u01/app/mongodb/admin/mdb01/etc/mongod_mdb01.service'.
2025-06-30 02:08:41 | WARNING | --------------------------------------------------------------------------------
2025-06-30 02:08:41 | WARNING | Copy the service file to /etc/systemd/system as root user :
2025-06-30 02:08:41 | WARNING | cp -p /u01/app/mongodb/admin/mdb01/etc/mongod_mdb01.service /etc/systemd/system/
2025-06-30 02:08:41 | WARNING | --------------------------------------------------------------------------------
2025-07-02 08:05:14 | WARNING | If this is the first MongoDB installation, and no log rotation is set, run as root:
--------------------------------------------------------------------------------
cp /u01/app/mongodb/local/dmk/templates/etc/mongo_logrotate.template /etc/logrotate.d/mongodb
sed -i 's|MONGO_LOG_ROOT|/u04/mongodb/log|g' /etc/logrotate.d/mongodb
chown root:root /etc/logrotate.d/mongodb
chmod 644 /etc/logrotate.d/mongodb
--------------------------------------------------------------------------------
2025-06-30 02:08:41 | INFO | Updating '/u01/app/mongodb/etc/mongodb.lst' file, adding mdb01
2025-06-30 02:08:41 | WARNING | Source DMK to load environment for the new instance mdb01 by executing the command 'dmk mdb01'.
2025-06-30 02:08:41 | INFO | MongoDB instance mdb01 created.
mongodb@vm00:/home/mongodb/ [DUMMY] dmk
mongodb@vm00:/home/mongodb/ [DUMMY] mdb01
---------- dbi services ----------
INSTANCE : mdb01
STATUS : STOPPED
VERSION : 8.0.16
BIND : 0.0.0.0
PORT : 27017
REPLICA SET STATUS : N/A (instance STOPPED)
CONFIGURATION FILE : /u01/app/mongodb/admin/mdb01/etc/mdb01.conf
DATA PATH : /u02/mongodb/data/mdb01
LOG FILE : /u04/mongodb/log/mdb01/mdb01.log
------------------------------------
use admin
db.createUser({user:"dmk", pwd:passwordPrompt(), roles:[{role:"root", db:"admin"}]})
mongodb@vm00:/home/mongodb/ [mdb01] ms
test> use admin
switched to db admin
admin> db.createUser({user:"dmk", pwd:passwordPrompt(), roles:[{role:"root", db:"admin"}]})
Enter password
{ ok: 1 }