- Home
- Unravel 4.6.2 Documentation
- Installation
- MySQL
- Installing MySQL
Installing MySQL
You can optionally install MySQL, if a database is not provisioned. MySQL should be installed before you install Unravel. Configure MySQL after you have installed Unravel.
1. 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.
2. Configure and start the 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 500 GB.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
) using the following commands: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
Important
Steps 3 and 4 must be run on the Unravel server.
3. Install MySQL.
yum install mysql