Installing and configuring 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:

Metric Insights v6.2.0+ currently supports MySQL 8.0.20 and 8.0.21 only.

Provisioning a database server

For production environments, we recommend the following:

  • Linux server running CentOS/RHEL 7+
  • 8 cores and 32GB memory
  • Sufficient disk space for mysql data files (500GB+)
  • Linux server should have outbound access to pull mysql packages or access to internal repositories containing mysql packages

MySQL by default installs to /var/lib so make sure disk space is allocated to /var (if it's a separate volume). If this is not possible, identify which volume space has been allocated so that we can move the mysql data files there.

Installing MySQL 8

Steps to install MySQL 8 (with outbound access):

  1. Download the MySQL RPM:
  2. Install the RPM:
    yum localinstall mysql80-community-release-el7-1.noarch.rpm
  3. Confirm MySQL is now available in the repository:
    yum repolist enabled | grep "mysql.*-community.*
  4. Install MySQL:
    yum install mysql-community-server
  5. Start MySQL:
    service mysqld start
  6. Get the temporary root user password to access MySQL:
    grep 'temporary password' /var/log/mysqld.log
  7. Initialize MySQL and go through the prompts:
    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
  8. Restart MySQL:
    service mysqld restart
  9. Set MySQL to auto-start on system startup:
    chkconfig mysqld on

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

Enter the new root user password when requested.

Configuring MySQL 8

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';

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/mysql/my.cnf.d/

Save and exit and create /etc/mysql/my.cnf.d if it doesn't already exist.

Set permissions for the my.cnf.d directory to 774 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. Please see this KB on what parameters to set: