Install and Configure MySQL 8

For orchestrated environments, we recommend installing MySQL 8 on remote database servers outside of the orchestrated environment (instead of running from inside of docker container in the orchestrated environment). Typically, MySQL will be managed by the Database Administrators (DBAs) on a pre-existing database cluster. In the event there is no DBA team to install, configure, and manage MySQL for us, follow the steps below on how to do this yourself:

NOTE: See Supported MySQL Versions for information on which MySQL versions are supported for your Metric Insights version.

Provision a Database Server

The MySQL database must be running on a separate server,  preferably on a database cluster managed by a DBA team or a native cloud  solution like Amazon RDS.

  • 8-Core CPU
  • 32 GB RAM
  • 1 TB+ HD total
    • If there are different volumes for specific filesystems, please ensure enough space is allocated to the following:
      • /var
    • MySQL data files by default live in /var/lib/mysql

On AWS, this equates to a db.m5.2xlarge RDS instance type.

On Azure, this equates to an 8 core Compute Gen 5server.

  • Linux server should have outbound access to pull mysql packages or access to internal repositories containing mysql packages

Install MySQL 8

Steps to install MySQL 8 (with outbound access):

  1. Visit the MySQL Community Download Archives:
    https://downloads.mysql.com/archives/community/
  2. Select MySQL Product Version 8.4.3 for the appropriate Linux OS
  3. Choose Operating System and OS Version
    • NOTE: Ensure that the correct OS Version is selected; e.g., RHEL 8 vs RHEL 9, etc.
  4. Choose the RPM Bundle (first result). Right-click the [Download] button and copy the link address
  5. Use the link copied above in Step 4 to then wget the MySQL RPM package to the database server: wget https://downloads.mysql.com/archives/get/p/23/file/mysql-8.4.3-1.el9.x86_64.rpm-bundle.tar
  6. Untar the MySQL RPM package from Step 5 above once it has been downloaded and saved to the database server/MySQL host: tar xvf mysql-8.0.28-1.el7.x86_64.rpm-bundle.tar
  7. Switch to root user: sudo -i
  8. Once the MySQL RPM package is unpacked from Step 6, in the same directory where the MySQL tarball was just unpacked, install all of the MySQL RPMs from the tarball with the command: dnf localinstall *.rpm
  9. Start the mysqld service: systemctl start mysqld
  10. Get the temporary root user password to access MySQL: grep 'temporary password' /var/log/mysqld.log
  11. Initialize MySQL and go through the prompts: mysql_secure_installation
    1. Set a new root user password
    2. Yes, remove anonymous users
    3. No, do not disallow root user login remotely
    4. Yes, remove the test database
    5. Yes, reload the privileges table
  12. Restart MySQL: systemctl restart mysqld
  13. Set MySQL to auto-start on system startup: systemctl enable mysqld

Confirm mysql access by opening the mysql prompt: mysql -u root -p

Enter the new root user password when requested.

Configure MySQL 8

  1. In the MySQL prompt, run the following command to remove a specific component that checks for special characters in generated passwords:
UNINSTALL COMPONENT 'file://component_validate_password';
  1. Still in the MySQL prompt, create a new root@% user who can access the MySQL DB from any host (this is needed because the machine where Metric Insights is installed needs access to MySQL, so there has to be a user who can access MySQL from somewhere other than the MySQL localhost):
create user 'root'@'%' identified by '<enter a new root@% PW here>'; 
  1. Once a new root@% user is created, now grant the user the necessary privileges with the command:
grant all privileges on *.* to 'root'@'%' with grant option;
  1. Next, flush privileges:
flush privileges;
  1. You can verify the list of grants/privileges with the command:
show grants for 'root'@'%';

The output for show grants above should look as follows:

  1. Exit the MySQL prompt and locate /etc/my.cnf. Open this file in an editor and add the following at the very end of the file:
!includedir /etc/my.cnf.d/
  1. Set permissions for the my.cnf.d directory to 755 and owned by root:root

Next, we need to create a mysql parameters file with custom values. This is done to optimize the mysql database for Metric Insights. See Fine-Tuning MySQL Parameters (v6.2+) on what parameters to set.