Sv translation |
---|
|
Common Installation TasksThese tasks are performed on all DB servers, no matter what role (master or slave) they are to perform. Attach STOREFirst of all, the STORE is connected to the machine, as described here: Mounting STORE - All Linux except for STORE (CentOS8/Win2019) Install MySQL and Install mysql-community-serverCentOS 8.x comes with some default repositories, which we do not want. These are disabled, and the MySQL repository is installed. Then the MySQL Server is installed. Enable the Debian MySQL 8.x repository and install it. Note, you will get asked some questions. Just get MySQL 8.x and say OK. translations-ignore Code Block |
---|
| wget https://dev.mysql.com/get/mysql-apt-config_0.8.16-1_all.deb
dpkg -i mysql-apt-config_0.8.16-1_all.deb |
Remove the Temporary .deb File Code Block |
---|
| rm -f mysql-apt-config_0.8.16-1_all.deb |
Update the Package List and Install MySQL Server Code Block |
---|
| apt-get update
apt-get # Make sure liibaio is on
dnf -y install libaio
# Disable some default stuff
dnf config-manager --disable mysql-connectors-community
dnf config-manager --disable mysql-tools-community
dnf -y module disable mysql
# Install the Oracle MySQL repo and the client
dnf -y install https://dev.mysql.com/get/mysql80-community-release-el8-1.noarch.rpm
dnf -y install mysql- community-server |
Start MySQLNext, the MySQL server is configured to autostart on boot, and started up: Translations Ignore |
---|
Code Block |
---|
|
|
systemctl enable mysqld.service
systemctl start mysqld.serviceThe debian installation will ask you some questions during installation:
- MySQL root Password
- Default authentication plugin - change to "Use Legacy Authentication Method"
The installer will also start and enable the mysql server.
Access to the MySQL Server is configured in the firewall:
Translations Ignore |
---|
Code Block |
---|
| firewall-cmd --zone=public --add-port=ufw allow 3306/tcp --permanent
firewall-cmd --reload |
|
Configuration Files
The Debian MySQL 8.x creates a configuration directory /etc/mymysql/mysql.cnfconf.d/ when it installs. The jtel configuration files are stored here, but a reference must be added to this directory so that mysql loads the configuration files.
This is added with the following command:
Translations Ignore |
---|
Code Block |
---|
|
cat <<EOFF >> /etc/my.cnf
#
# * IMPORTANT: Additional settings that can override those from this file!
# The files must end with '.cnf', otherwise they'll be ignored.
#
!includedir /etc/my.cnf.d/
EOFF
|
The next command downloads the main configuration file for the mysql server. This file is downloaded and stored here. This file contains a lot of well commented settings which can be tweaked if required. The main parameter to be changed is the RAM usage of the sever. See below.
Translations Ignore |
---|
Code Block |
---|
| wget -P /etc/mymysql/mysql.cnfconf.d http://cdn.jtel.de/downloads/configs/jtel-enhanced-8-deb.cnf |
|
Restart In order that the server makes the best use of the RAM available, the configuration file /etc/mysql/mysql.conf.d/jtel-enhanced-8.cnf must be adapted.
The setting innodb_buffer_pool_size should be adapted to about 3/4 of the available RAM, but a minimum of 3-4 GB should remain for the use of other processes. For Servers with 4 GB RAM, this should not exceed 2 GB. Now, the MySQL must be restarted:
Translations Ignore |
---|
Code Block |
---|
| systemctl restart mysqld.service |
|
After the first restart, user access must be setup.
MySQL 8.x saves a generated random password for the root user in the file /var/log/mysqld.log
This password must be extracted. Often, it contains special characters which cannot be input on the command line within a script. For the following command the password is input manually. Note, that <password> refers to the NEW password you want to assign to the root account.
Status |
---|
colour | Red |
---|
title | Caution Password |
---|
|
# For 4 GB RAM
innodb_buffer_pool_size = 2048M
# For 8 GB RAM
innodb_buffer_pool_size = 5120M
# For 12 GB RAM
innodb_buffer_pool_size = 8192M
# For 16 GB RAM
innodb_buffer_pool_size = 12288M
...
# From 16 GB simply take 3/4 of the RAM |
|
Restart MySQL
The MySQL server is restarted to load all configuration settings.
Translations Ignore |
---|
Code Block |
---|
| mysqladmin -u root -p password '<password>'title | Restart the MySQL server |
---|
| systemctl restart mysql |
|
After the first restart, user access must be setup.
The following commands configure the further users required:
Status |
---|
colour | Red |
---|
title | Caution Password |
---|
|
Translations Ignore |
---|
Code Block |
---|
| mysql -u root -p<password> -v -e"CREATE USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '<password>'"
mysql -u root -p<password> -v -e"GRANT ALL ON *.* TO 'root'@'%' WITH GRANT OPTION"
mysql -u root -p<password> -v -e"FLUSH PRIVILEGES" |
|
Install UDP Plugin
Next, the UDP plugin is installed. This is required for the communication with further software modules in the system, when certain DB changes are made.
The installation is slightly different for master and slave servers.
Installation
Master Server
Translations Ignore |
---|
Code Block |
---|
| cp /home/jtel/shared/JTELCarrierPortal/Libraries/jtel_udf_udpsend/jtel_udf_udpsend.so /usr/lib64lib/mysql/plugin/
chown root:root /usr/lib64lib/mysql/plugin/jtel_udf_udpsend.so
chmod 755644 /usr/lib64/mysql/plugin/jtel_udf_udpsend.so
chcon system_u:object_r:lib_t:s0 /usr/lib64/mysql/plugin/jtel_udf_udpsend.so |
|
Slave Server
Translations Ignore |
---|
Code Block |
---|
| cp /home/jtel/shared/JTELCarrierPortal/Libraries/jtel_udf_udpsend/dummy/jtel_udf_udpsend.so /usr/lib64lib/mysql/plugin/
chown root:root /usr/lib64lib/mysql/plugin/jtel_udf_udpsend.so
chmod 755644 /usr/lib64/mysql/plugin/jtel_udf_udpsend.so
chcon system_u:object_r:lib_t:s0 /usr/lib64/mysql/plugin/jtel_udf_udpsend.so |
|
Configuration
To configure the plugin, the following commands are executed:
Status |
---|
colour | Red |
---|
title | Caution Password |
---|
|
Translations Ignore |
---|
Code Block |
---|
| mysql -u root -p<password> -v -e"DROP FUNCTION IF EXISTS udpsend"
mysql -u root -p<password> -v -e"CREATE FUNCTION udpsend RETURNS STRING SONAME 'jtel_udf_udpsend.so'" |
|
Note |
---|
|
The configuration of the UDP plugin must be performed before the server is included in any replication between servers, otherwise replication will fail. The UDP plugin must be installed on all servers. |
In order that the server makes the best use of the RAM available, the configuration file /etc/my.cnf.d/jtel-enhanced-8.cnf must be adapted.
The setting innodb_buffer_pool_size should be adapted to about 3/4 of the available RAM, but a minimum of 3-4 GB should remain for the use of other processes For Servers with 4 GB RAM, this should not exceed 2 GB. Translations Ignore |
---|
Code Block |
---|
|
# For 4 GB RAM
innodb_buffer_pool_size = 2048M
# For 8 GB RAM
innodb_buffer_pool_size = 5120M
# For 12 GB RAM
innodb_buffer_pool_size = 8192M
# For 16 GB RAM
innodb_buffer_pool_size = 12288M
...
# From 16 GB simply take 3/4 of the RAM |
Restart MySQL
Finally, the MySQL server is restarted for the last time, to load all configuration settings.
Translations Ignore |
---|
Code Block |
---|
|
language | bash |
---|
title | Restart the MySQL server |
---|
|
systemctl restart mysqld.service
Sv translation |
---|
|
Status |
---|
colour | Red |
---|
title | THIS PAGE IS ONLY AVAILABLE IN ENGLISH |
---|
|
|