- Home
- Unravel 4.5 Documentation
- Installation
- Add-ons
- MySQL
- Install and configure MySQL for Unravel
Install and configure MySQL for Unravel
Important
This installation is for a dedicated MySQL node without being collocated with Unravel.
MySQL isn't supported for POC installations.
To use MySQL with Unravel, follow these steps.
Hardware requirements for the MySQL host
Jobs per day | Data retention length | Cores | RAM | Disk |
---|---|---|---|---|
Less than 25,000 | 14-30 days | 10 | 32 GB | 1 TB |
45 days | 10 | 64 GB | 2 TB | |
60 days | 10 | 64 GB | 3 TB | |
25,000 to 100,000 | 14-30 days | 40 | 128 GB | 3-5 TB |
45 days | 40 | 256 GB | 8-10 TB | |
60 days | 40 | 256 GB | 12-15 TB | |
Over 100,000 | 14-30 days | 80 | 512 GB | 15 TB |
45 days | 80 | 768 GB | 30 TB | |
60 days | 80 | 768 GB | 45 TB |
Permissions needed
You must have root access or "sudo root" permission to install MySQL.
Before installing the Unravel RPM, complete the following steps.
Install a compatible version of MySQL server and database.
On CentOS 6:
wget https://dev.mysql.com/get/mysql80-community-release-el6-1.noarch.rpm sudo yum install yum-utils sudo rpm -ivh mysql80-community-release-el6-1.noarch.rpm sudo yum-config-manager --disable mysql80-community sudo yum-config-manager --enable mysql57-community sudo yum install mysql-community-server
On CentOS 7:
wget https://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm sudo rpm -ivh mysql80-community-release-el7-1.noarch.rpm sudo yum-config-manager --disable mysql80-community sudo yum-config-manager --enable mysql57-community sudo yum install mysql-community-server
On SELinux:
If you are installing MySQL on an SELinux host and are not using the default
datadir
, see Deploying Unravel on security-enhanced Linux.
Configure and start MySQL server.
If the MySQL server is running, stop it and delete the old InnoDB log files.
If you need to save your old InnoDB log files copy them to a directory of your choosing,
backup-path
before deletion.sudo service mysqld stop cp /var/lib/mysql/ib_logfile*
backup-path
rm -rf /var/lib/mysql/ib_logfile*In the MySQL configuration file (typically
/etc/my.cnf
), append the following properties at the end of the[mysqld]
section. Setdatadir
to the directory your choice. This directory must have a minimum capacity of 500GB.key_buffer_size = 256M max_allowed_packet = 32M sort_buffer_size = 32M # Do not add query_cache_size when using MySQL 8 as it is no longer valid query_cache_size = 64M max_connections = 500 max_connect_errors = 2000000000 open_files_limit = 10000 port-open-timeout = 121 expire-logs-days = 1 character_set_server = utf8 collation_server = utf8_unicode_ci innodb_open_files = 2000 innodb_file_per_table = 1 innodb_data_file_path = ibdata1:100M:autoextend # The innodb_buffer_pool_size depends on load and cluster size. # On a dedicated machine, it can be 50% of the RAM size. # Using 1G is the absolute minimum. For a large cluster, we use 48G. innodb_buffer_pool_size = 4G innodb_flush_method = O_DIRECT innodb_log_file_size = 256M innodb_log_buffer_size = 64M innodb_flush_log_at_trx_commit = 2 innodb_lock_wait_timeout = 50 innodb_thread_concurrency = 20 innodb_read_io_threads = 16 innodb_write_io_threads = 4 binlog_format = mixed # if SSD disk is used uncomment the line below #innodb_io_capacity = 4000
Ensure MySQL server starts at boot time and then start the MySQL server
On CentOS 6:
sudo chkconfig mysqld on sudo service mysqld start
On CentOS 7:
sudo systemctl enable mysqld sudo systemctl start mysqld
Check the used and free space on the volume specified by MySQL's datadir property in the MySQL configuration file (typically
/etc/my.cnf
):Used and Free Space
sudo grep "^datadir=" /etc/my.cnf | awk -F"[=]" '{print $2}' | sudo xargs du -sh sudo grep "^datadir=" /etc/my.cnf | awk -F"[=]" '{print $2}' | sudo xargs df -h
Install the MySQL JDBC driver.
Download the JDBC driver for MySQL to
/tmp
. Then navigate to /tmp and extract the driver.wget https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.47.tar.gz -O /tmp/mysql-connector-java-5.1.47.tar.gz cd /tmp tar xvzf /tmp/mysql-connector-java-5.1.47.tar.gz
Install MySQL.
yum install mysql
After installing the Unravel RPM, complete the following steps.
Copy the MySQL JDBC JAR to
/usr/local/unravel/share/java/
.sudo mkdir -p /usr/local/unravel/share/java sudo cp /tmp/mysql-connector-java-5.1.47/mysql-connector-java-5.1.47.jar /usr/local/unravel/share/java sudo cp /tmp/mysql-connector-java-5.1.47/mysql-connector-java-5.1.47.jar /usr/local/unravel/dlib/unravel
Configure Unravel to connect to the MySQL server.
Using mysql, create a database and user for Unravel.
mysql mysql> CREATE DATABASE unravel_mysql_prod; mysql> CREATE USER 'unravel'@'localhost' IDENTIFIED BY '
password
'; mysql> GRANT ALL PRIVILEGES ON unravel_mysql_prod.* TO 'unravel'@'localhost';In
/usr/local/unravel/etc/unravel.properties
, update the following properties:Important
These properties define the connection to Unravel's database, not the Hive's database.
If you are using
Unravel's bundled database (PostgreSQL), don't modify these properties.
An external database, for example MySQL, update these properties as instruction in Install MySQL.
Property/Description
Set by user
Unit
Default
unravel.jdbc.username
Unravel database user.
Required
string
-
unravel.jdbc.password
Password for unravel.jdbc.username.
Required
string
-
unravel.jdbc.url
URL for jdbc, determined by your database.
Example:
jdbc:mysql://127.0.0.1:3306/unravel_mysql_prod
Required
string
(path)
-
For example,
unravel.jdbc.username=unravel unravel.jdbc.password=
password
unravel.jdbc.url=jdbc:mysql://127.0.0.1:3306/unravel_mysql_prodImportant
If you installed MySQL 8.0, add:
unravel.jdbc.url.params=disableMariaDbDriver
Create a schema for Unravel tables.
sudo /usr/local/unravel/dbin/db_schema_upgrade.sh
Create the default admin user for Unravel UI.
sudo /usr/local/unravel/install_bin/db_initial_inserts.sh | /usr/local/unravel/install_bin/db_access.sh
Disable PostgreSQL.
Once you have successfully configured Unravel to use the MySQL database, disable the
unravel_pg
PostgreSQL database and deactivate the service for all run levels. In other words, run this command on the Unravel host(s):sudo service unravel_pg stop; sudo chkconfig unravel_pg off