Enabling MongoDB authentication
You need to enable MongoDB authentication for the Digital Assets Management (DAM) and Machine learning features.
Procedure
-
In the MongoDB console, create a user having following role and access by using the
following command.
MongoDB 7.0
MongoDB 4.0.25 and earlier>mongosh use admin; db.createUser( { user: "<username>", pwd: "<password>", roles: [ { role: "userAdminAnyDatabase", db: "admin" }, "readWriteAnyDatabase" ] } )
>mongo use admin; db.createUser( { user: "<username>", pwd: "<password>", roles: [ { role: "userAdminAnyDatabase", db: "admin" }, "readWriteAnyDatabase" ] } )
-
Open MongoDB configuration file by using the following command.
vi /etc/mongod.conf
-
In the mongod.conf file, edit the value of the following
property.
security: authorization: enabled
-
Quit the MongoDB shell by pressing, Ctrl + C and
then restart the MongoDB using the following command.
service mongod restart
-
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=
- 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.
- 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.
-
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>
- Copy and paste the MongoDB credentials in all the three files.
-
Run the following command to encrypt the password specified in the step 1.
- Restart IBM® Product Master services.