Task 2 Install and configure MongoDB
We recommend installing and configuring MongoDB before installing Total Test repository server.
Set up these tasks:
Download MongoDB from https://www.mongodb.com/download-center/community and follow the installation instructions at https://docs.mongodb.com/manual/administration/install-community/ and BMC AMI Web Products Installation and Configuration Guide.
- (Optional) Configure authentication and SSL.
Modifying the MongoDB User Password without Re-installation on RHEL 8
This section explains how to modify the MongoDB user password without reinstalling CES or Total Test on RHEL 8. The procedure applies to both clear-text and encrypted passwords.
Prerequisites
Before starting the password modification process, ensure the following prerequisites are met:
- You have root or sudo privileges on the system where CES and MongoDB are installed.
- CES and MongoDB are installed and functioning correctly.
- You know the current MongoDB user credentials.
- You have the master password (masterPrd) if encrypted passwords are in use.
You have access to the following directories:
- CES installation directory (where execces.sh and encrypter.sh are located), for example /CES
- CES data directory containing the configuration file, for example /Compuware/ces/data/totaltest/config/application.properties
Backup the configuration file before making any changes:
sudo cp /Compuware/ces/data/totaltest/config/application.properties \
/Compuware/ces/data/totaltest/config/application.properties.bak.$(date +%Y%m%d%H%M)
Steps to Modify the MongoDB Password
The following are the steps to modify the MongoDB password:
- Open a terminal in the CES installation directory where the execces.sh file exists (for example, /CES). Keep this terminal open for the entire process.
- Stop the currently running CES instance:
sudo ./execces.sh stop - Stop the MongoDB process:
sudo service mongod stop - Locate and open the application.properties file.
Example:
/Compuware/ces/data/totaltest/config/application.properties
(This path is specified during CES / Total Test installation.) - Update the MongoDB password property.
Modify the mongodb.prd property with the new password that you want to use, and then save the file. - Start the MongoDB process:
sudo systemctl start mongod - Verify that MongoDB has started successfully:
sudo systemctl status mongod
Optionally, ensure that MongoDB will start automatically after a system reboot:
sudo systemctl enable mongod
(Optional) Verify database access. To do this, open a new terminal and start a Mongo shell session on the same host machine:
mongoshThen connect to your database:
use <database-name>
Restart CES: In the terminal where CES was previously stopped, run:
sudo ./execces.sh start
Verify CES connectivity
Access CES from the respective port and verify that the database is accessible and data is being reflected correctly. Once CES has started successfully, you can close the terminal used for stopping and starting the CES instance.
Using the encrypter.sh Script
The application.properties file is located at:
CES_DATA_DIRECTORY/totaltest/config/application.properties
For a pilot installation, all properties can remain as default. However, for production usage, enabling security settings on the database connection is recommended.
Configuring MongoDB Authorization
When MongoDB is configured with authorization:
- Set the mongodb.secured property to true.
- Specify the username and password in the mongodb.username and mongodb.prd properties.
If the password should not be stored in clear text, use the provided encryption utility, encrypter.sh, to securely encrypt it.
Encrypting the MongoDB Password
- Navigate to the CES installation directory where the encrypter.sh script is located.
Run the encryption tool:
./encrypter.sh
The tool will encrypt the password and automatically update the application.properties file, replacing the mongodb.prd value with the encrypted password.
During CES Installation
The CES installer provides an option to configure MongoDB authorization. If enabled, the installer will automatically encrypt the password using the encrypter.sh tool.