Enabling MongoDB authentication

You need to enable MongoDB authentication for the Digital Assets Management (DAM) and Machine learning features.

Procedure

  1. In the MongoDB console, create a user having following role and access by using the following command.
    MongoDB 7.0
    >mongosh
    use admin;
    db.createUser(
      {
        user: "<username>",
        pwd: "<password>",
        roles: [ { role: "userAdminAnyDatabase", db: "admin" }, "readWriteAnyDatabase" ]
      }
    )
    MongoDB 4.0.25 and earlier
    >mongo
    use admin;
    db.createUser(
      {
        user: "<username>",
        pwd: "<password>",
        roles: [ { role: "userAdminAnyDatabase", db: "admin" }, "readWriteAnyDatabase" ]
      }
    )
  2. Open MongoDB configuration file by using the following command.
    vi /etc/mongod.conf
  3. In the mongod.conf file, edit the value of the following property.
    security:
        authorization: enabled
  4. Quit the MongoDB shell by pressing, Ctrl + C and then restart the MongoDB using the following command.
    service mongod restart
  5. In env_settings.ini file, specify the value of the following properties using the values specified in the step 1.
    mmongodb_username=
    mongodb_password=
    mongodb_database=
  6. Run the configureEnv.sh script with the -ov option. The specified values get copied to the dam.properties, common.properties, and ml_configuration.ini files.
  7. Optional: If you do not want to run the configureEnv.sh script with the -ov option. You can manually update the dam.properties, common.properties, and ml_configuration.ini file as follows.
    1. Run the following command to encrypt the password specified in the step 1.
      $JAVA_RT com.ibm.ccd.common.generate.config.DBEncryptionUtils -encrypt --password=<password> 
    2. Copy and paste the MongoDB credentials in all the three files.
  8. Restart IBM® Product Master services.