Configuring MariaDB

HCL Detect requires a relational database to store configuration as well as run-time data used by the applications as it runs.

Installing MariaDB

MariaDB is executed as a service on OpenShift and its behavior is controlled by a configuration file (usually located in /etc/my.cnf.d/server.cnf on OpenShift. In this file, specifically in the mysqld section of the configuration, the following entry must be updated as shown:

bind-address = 0.0.0.0

This change will ensure that other hosts in the cluster can interact with the MariaDB server.

The configuration modifications only become active after a server restart, which requires restarting the specific operating system service as follows. On OpenShift:

- sudo systemctl restart mariadb

For more information on installing MariaDB, refer to .Installing MariaDB

Setting up a MariaDB user

Once MariaDB is properly installed, it must be configured with a user and password to be used by HCL Detect when establishing connections with the database server. By default, both the user and password are set to drive.

To create a MariaDB user called drive with the password drive, start MariaDB's interactive shell using MariaDB's root user:

$ mysql -u root -p

And issue the following command:

MariaDB [(none)]> CREATE USER 'drive'@'%' IDENTIFIED BY 'drive';

Once the user is created, it must be given privileges to create the HCL Drive databases:

MariaDB [(none)]> GRANT ALL PRIVILEGES ON `drive_%` . * TO 'drive'@'%';
MariaDB [(none)]> FLUSH PRIVILEGES;

You can now close the MariaDB interactive shell by pressing CTRL-D (the Control and the D key, together) or by using the exit command.

At this point you should be able to login to MariaDB using the user drive and authenticate using the initial, default, password you just configured:

$ mysql -u drive -h <VM IP address> -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 39
...
MariaDB [(none)]>
Note: For every new build, make sure to drop the existing database "drive_acme_core".