Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Content imported from a Scroll Translations translation file.
Sv translation
languageen

Table of Contents
maxLevel3
printablefalse

Functional Components of the Role

The DATA role can be split on one or more servers. A setup with only one DATA server is only recommended for very small installations. The division corresponds to the following functional components:

FunctionDescriptionAccessQuantityRedundancy strategy
PrimaryAll write accesses occur here. Furthermore, all functional routines that change data are always executed here. Especially the call distribution is done here.Write and Read1Can be designed redundantly through an active/passive configuration.
ReportingCreation of complex data evaluations. These operations typically require a high level of storage, computation and I/O resources.Read0 - nIn very large systems, different groups of web servers can be distributed to different reporting slaves. Furthermore, several Reporting Slaves can be combined as an Active/Active Cluster

Realtime Statistics

Calculation of real-time statistics at short intervals for logged in users or supervisors and wallboards.Read0 - nIn very large systems, different groups of web servers can be distributed to different statistics slaves. Furthermore, several statistic slaves can be combined as an Active/Active Cluster
Customer queriesCreation of customer-specific data evaluations. The outsourcing of this function in a separate system serves primarily to protect the core system.Read0 - n

From the installation point of view, these functional components have no effect because a complete local (synchronized) version of the database is stored on each server in the network. The distribution of the functions results more from the point of view of the "consumers" in which it is possible to configure which server can be accessed for which tasks. In the Web application server, for example, it is possible to specify the database connection for the primary, reporting, and real-time areas separately, so that it is possible to distribute these roles among different servers.

The only aspect of the installation that is affected by the function distribution is that if you are distributing the functions to different servers, you will need to build and configure an appropriate MySQL replication setup. This means that the "Primary" function is forced to run on a Replication Master, while all other functions can run on Replication Slaves.

Another very special type of configuration is a special setup in which two servers are connected in a master-master replication (which in turn can be used as masters for other slaves). In such a highly available configuration, only one of the masters is used as "primary". The other would normally serve as a passive reserve of the HA cluster. However, it is advisable to use this resource more sensibly by having the passive master perform either the "reporting" or the "statistics" function. The function-related IP addresses are managed by the HA manager. Such a configuration has the advantage of offering a high degree of availability without being too wasteful with resources.

Common installation steps

Independent of the function that a DATA server is to take over, the following installation steps must first be carried out on both master and slave.

Linking the data area

Connect data area as described on the page Connection STORE (All Linux except STORE)

Installing the Software

To include the official MySQL software repositories and install the MySQL server, use the following commands:

MySQL 8.x 

Translations Ignore


Code Block
languagebash
titleMySQL 8.x
yum -y install libaio
yum -y install https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
yum -y install mysql-community-server



 MySQL 5.6

Translations Ignore


Code Block
languagebash
titleMySQL 5.6
yum -y install http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm
yum -y install mysql-community-server



Both variants

The MySQL Server service is added to the list of automatically starting services and started with the following command:

Translations Ignore


Code Block
languagebash
titleMySQL service autostart
chkconfig mysqld on
service mysqld start



Next, the port shares for the MySQL server service must be entered and permanently stored in the firewall:

Translations Ignore


Code Block
languagebash
titleConfigure firewall
firewall-cmd --zone=public --add-port=3306/tcp --permanent
firewall-cmd --reload



To simplify the configuration of the MySQL server, a directory is now created where modular configuration files can be stored. In order for these to be loaded from MySQL Server, an entry must be made in the main configuration file. This is done by entering the following commands:

Translations Ignore


Code Block
languagebash
titleConfigure MySQL Server
mkdir /etc/my.cnf.d
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
semanage fcontext -a -t mysqld_etc_t "/etc/my\.cnf\.d(/.*)?"
restorecon -R -v /etc/my.cnf.d



These commands create the directory, add the load instruction for the modular configuration files to the main configuration file, create a SELINUX security share for the new configuration directory and generate the corresponding security labels.

Next, a modular configuration file with some commented relevant optimization settings is imported.

MySQL 8.x

Translations Ignore


Code Block
languagebash
titleLoad the basic settings
wget -P /etc/my.cnf.d http://cdn.jtel.de/downloads/configs/jtel-enhanced-8.cnf



The File /etc/mycnf.d/jtel-enhanced-8.cnf contains a number of well-commented configuration statements that can be used to optimize the functionality of the MySQL Server. Most of these instructions are commented upon. If necessary, these parameters should be adjusted with caution. However, the default values should be fine for most installations.

MySQL 5.6

Translations Ignore


Code Block
languagebash
titleLoad the basic settings
wget -P /etc/my.cnf.d http://cdn.jtel.de/downloads/configs/jtel-enhanced.cnf




The File /etc/mycnf.d/jtel-enhanced.cnf contains a number of well-commented configuration statements that can be used to optimize the functionality of the MySQL Server. Most of these instructions are commented upon. If necessary, these parameters should be adjusted with caution. However, the default values should be fine for most installations.

Both Variants

Now the MySQL server must be restarted:

Translations Ignore


Code Block
languagebash
titleStart MySQL Server
service mysqld restart



After the first start of the MySQL server, the access data for the root user must now be defined.

Since in MySQL a user account consists not only of a username but also of an origin address of the connection, another root user must be created to connect from any origin address. 

MySQL 8.x

MySQL 8.x stores a generated password for the root user in the file /var/log/mysqld.log

This password must be extracted first. Since it often contains special characters that cannot easily be entered in the command line, the first adjustment is made by entering the password manually.

Translations Ignore


Code Block
languagebash
titleMySQL 8.x - Create and configure server users
mysqladmin -u root -p password '<password>'



Then the following command chain is entered to create the additional user:

ATTENTION: replace <password> with the corresponding password.

Translations Ignore


Code Block
languagebash
titleMySQL 8.x - Create and configure server users
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"



MySQL 5.6

ATTENTION: replace <password> with the corresponding password.

Translations Ignore


Code Block
languagebash
titleMySQL 5.6 - Create and configure server users
mysqladmin -u root password '<password>'
mysql -u root -p<password> -v -e"CREATE USER 'root'@'%' IDENTIFIED 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"



Both Variants

Next, an additional plugin module is added to MySQL Server. This module is required from jtel software version 3.06 for communication with other software components. For new installations, it should also be installed if it is planned to install older revisions of the software, so that nothing hinders a later update. This is done with the following commands:

Translations Ignore


Code Block
languagebash
titleInstall UDP Send Plugin - MASTER
cp /home/jtel/shared/JTELCarrierPortal/Libraries/jtel_udf_udpsend/jtel_udf_udpsend.so /usr/lib64/mysql/plugin/
chown root:root /usr/lib64/mysql/plugin/jtel_udf_udpsend.so
chmod 755 /usr/lib64/mysql/plugin/jtel_udf_udpsend.so
chcon system_u:object_r:lib_t:s0  /usr/lib64/mysql/plugin/jtel_udf_udpsend.so



Translations Ignore


Code Block
languagebash
titleInstall UDP Send Plugin - SLAVE
cp /home/jtel/shared/JTELCarrierPortal/Libraries/jtel_udf_udpsend/dummy/jtel_udf_udpsend.so /usr/lib64/mysql/plugin/
chown root:root /usr/lib64/mysql/plugin/jtel_udf_udpsend.so
chmod 755 /usr/lib64/mysql/plugin/jtel_udf_udpsend.so
chcon system_u:object_r:lib_t:s0  /usr/lib64/mysql/plugin/jtel_udf_udpsend.so



To make the additional function available to SQL procedures, the following command must be executed (replace <password> with the corresponding password):

Translations Ignore


Code Block
languagebash
titleRegister the UDP send command
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
titleImportant Note

The SQL commands listed above must be executed on a database server before it becomes part of a replication group. If the UDP plugin is to be retrofitted on existing DATA servers, a different procedure must be selected:

  1. The module must be copied to the plugin directory on all servers of the group (both master and slaves) (see code block "Install UDP Send Plugin")
  2. The plugin may only be registered on the master server. Since the command is also executed on the slaves by replication, it is not necessary to execute the command there as well.

ATTENTION: If the command is executed without the UDP plugin being present on all servers in the network, the replication is aborted and can only be repaired by manual intervention.

Adaptation of my.cnf to server RAM

In order for the server to make full use of the provided RAM, a configuration must be adjusted with vi.

This setting should be about 3/4 of the server's RAM, but leave 3-4 GB for mysql and other processes.

Translations Ignore


Code Block
languagebash
titlevi /etc/my.cnf.d/jtel-enhanced.cnf
# 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




MySQL Restart

Finally, the MySQL server is restarted so that all settings are applied:

Translations Ignore


Code Block
languagebash
titleRestart the MySQL server
service mysqld restart




Sv translation
languagede

Table of Contents
maxLevel3
printablefalse

Funktionelle Komponenten der Rolle

Die Rolle DATA kann auf einem oder mehrere Server aufgeteilt werden, wobei ein Setup mit nur einem DATA server nur bei sehr kleinen Installationen zu empfehlen ist. Die Aufteilung entspricht dabei folgenden funktionellen Komponenten:

FunktionBeschreibungZugriffMengeRedundanzstrategie
PrimaryAlle Schreibzugriffe erfolgen hier. Des weiteren wird hier immer alle funktionellen Routinen ausgeführt, die Daten verändern. Insbesondere die Anrufverteilung erfolgt hier.Schreiben und Lesen1Kann durch eine Active/Passive Konfiguration redundant ausgelegt werden
ReportingErstellung komplexer Datenauswertungen. Diese Vorgänge erfordern mitunter ein hohes Maß an Speicher-, Berechnungs- und I/O Ressourcen.Lesen0 - nIn sehr großen Systemen können verschiedene Gruppen Web-Server auf verschiedene Reporting-Slaves aufgeteilt werden. Des weiteren können mehrere Reporting-Slaves als Active/Active Cluster zusammengefasst werden
Realtime StatistikBerechnung der Echtzeitstatistiken in kurzen Intervallen für die angemeldeten Benutzer bzw. Supervisoren und Wallboards.Lesen0 - nIn sehr großen Systemen können verschiedene Gruppen Web-Server auf verschiedene Statistik-Slaves aufgeteilt werden. Des weiteren können mehrere Statistik-Slaves als Active/Active Cluster zusammengefasst werden
Kunden AbfragenErstellung kundenspezifischer Datenauswertungen. Die Auslagerung dieser Funktion in einem separaten System dient vor allen der Absicherung des KernsystemsLesen0 - n

Aus Sicht der Installation haben diese funktionelle Komponenten keine Auswirkungen da eine vollständige lokale (synchronisierte) Fassung der Datenbank auf jedem Server des Verbundes lagert. Die Aufteilung der Funktionen ergibt sich mehr aus Sicht der "Verbraucher" in denen Konfiguriert werden kann, auf welchem Server gegebenenfalls für welche Aufgaben zugegriffen werden kann. So ist es z.B. im Web-Application-Server möglich, die Datenbankanbindung für die Bereiche Primary, Reporting und Realtime separat anzugeben, so dass es möglich ist, diese Rollen auf verschiedene Server aufzuteilen.

Der einzige Aspekt der Installation der durch die Funktionsaufteilung betroffen ist, ergibt sich aus der Tatsache, dass bei einem Verteilen der Funktionen auf verschiedene Server ein entsprechendes MySQL-Replikations-Setup aufgebaut und konfiguriert werden muss. Dadurch ergibt sich, dass die Funktion "Primary" erzwungenermaßen auf einem Replikations-Master läuft, während alle anderen Funktionen auf Replikations-Slaves laufen können.

Eine sehr besondere Art der Konfiguration ist des weiteren ein spezielles Setup in dem zwei Server in einer Master-Master-Replikation zusammengeschlossen werden (die wiederrum beide als Master für weitere Slaves diesenen können). In einer solchen hoch verfügbaren Konfiguration wird nur einer der Master als "Primary" verwendet. Der andere würde üblicherweise als passive Reserve des HA-Clusters dienen. Es bietet sich allerdings an, diese Ressource sinnvoller zu nutzen, in dem der passive Master entweder die "Reporting" oder die "Statistik" Funktion übernimmt. Die Funktionsbezogenen IP-Adressen werden soweit vom HA-Manager verwaltet. Eine solche Konfiguration hat den Vorteil ein hohes Maß an Verfügbarkeit zu bieten, ohne allzu verschwenderisch mit den Ressourcen umzugehen.

Gemeinsame Installationsschritte

Unabhängig von der Funktion die ein DATA Server übernehmen soll, sind erst mal folgende Installationsschritte zu tätigen auf sowohl Master als auch Slave.

Anbinden des Datenbereiches

Datenbereich anbinden, wie auf der Seite Linking STORE (All Linux except STORE) beschrieben.

Installation der Software

Das Einbinden der offiziellen MySQL Software Repositores und die Installation des MySQL-Servers erfolgt mit folgenden Befehlen:

MySQL 8.x 

Translations Ignore


Code Block
languagebash
titleMySQL 8.x
yum -y install libaio
yum -y install https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
yum -y install mysql-community-server



 MySQL 5.6

Translations Ignore


Code Block
languagebash
titleMySQL 5.6
yum -y install http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm
yum -y install mysql-community-server



Beide Varianten

Der MySQL Server Dienst wird mit folgendem Befehl in die Liste der automatisch startenden Dienste aufgenommen und gestartet.

Translations Ignore


Code Block
languagebash
titleMySQL service autostart
chkconfig mysqld on
service mysqld start



Als nächstes müssen in der Firewall die Port-Freigaben für den MySQL Server Dienst eingetragen und persistent gespeichert werden:

Translations Ignore


Code Block
languagebash
titleConfigure firewall
firewall-cmd --zone=public --add-port=3306/tcp --permanent
firewall-cmd --reload



Um die Konfiguration des MySQL Servers zu vereinfachen, wird nun ein Verzeichnis angelegt, in dem modulare Konfigurationsdateien abgelegt werden können. Damit diese auch vom MySQL Server geladen werden, muss in der Hauptkonfigurationsdatei noch ein Eintrag erfolgenden. Dies erfolgt durch die Eingabe folgender Befehle:

Translations Ignore


Code Block
languagebash
titleConfigure MySQL Server
mkdir /etc/my.cnf.d
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
semanage fcontext -a -t mysqld_etc_t "/etc/my\.cnf\.d(/.*)?"
restorecon -R -v /etc/my.cnf.d



Diese Befehle erzeugen das Verzeichnis, fügen der Hauptkonfigurationsdatei die Ladeanweisung für die modularen Konfigurationsdateien hinzu, erstellen eine SELINUX-Sicherheitsfreigabe für das neue Konfigurationsverzeichnis und erzeugen die entsprechenden Security-Labels.

Als nächstes wird eine modulare Konfigurationsdatei mit einigen kommentierten relevanten Optimierungseinstellungen eingespielt.

MySQL 8.x

Translations Ignore


Code Block
languagebash
titleLoad the basic settings
wget -P /etc/my.cnf.d http://cdn.jtel.de/downloads/configs/jtel-enhanced-8.cnf



Die Datei /etc/mycnf.d/jtel-enhanced-8.cnf enthält eine Reihe gut kommentierter Konfigurationsanweisungen mit denen die Funktion des MySQL Server optimiert werden kann. Die meisten dieser Anweisungen sind auskommentiert. Je nach Bedarf sollten diese Parameter mit Vorsicht angepasst werden. Die Standardwerte sollten aber für die meisten Installationen in Ordnung sein.

MySQL 5.6

Translations Ignore


Code Block
languagebash
titleLoad the basic settings
wget -P /etc/my.cnf.d http://cdn.jtel.de/downloads/configs/jtel-enhanced.cnf




Die Datei /etc/mycnf.d/jtel-enhanced.cnf enthält eine Reihe gut kommentierter Konfigurationsanweisungen mit denen die Funktion des MySQL Server optimiert werden kann. Die meisten dieser Anweisungen sind auskommentiert. Je nach Bedarf sollten diese Parameter mit Vorsicht angepasst werden. Die Standardwerte sollten aber für die meisten Installationen in Ordnung sein.

Beide Varianten

Nun muss der MySQL Server neu gestartet werden:

Translations Ignore


Code Block
languagebash
titleStart MySQL Server
service mysqld restart



Nach dem ersten Start des MySQL Servers müssen nun die Zugangsdaten für den root-Benutzer festgelegt werden.

Da in MySQL ein Benutzerkonto nicht nur aus einem Benutzernamen sondern auch aus eine Herkunftsadresse der Verbindung besteht, muss noch ein weiterer root-Benutzer erzeugt werden, der sich von beliebigen Herkunftsadressen verbinden darf. 

MySQL 8.x

MySQL 8.x speichert ein generiertes Passwort für den root Benutzer in der Datei /var/log/mysqld.log

Dieses Passwort muss als erstes extrahiert werden. Da es oft Sonderzeichen enthält, die nicht ohne Weiteres in die Kommandozeile eingegeben werden können, erfolgt die erste Anpassung durch manuelle Eingabe des Passwortes.

Translations Ignore


Code Block
languagebash
titleMySQL 8.x - Create and configure server users
mysqladmin -u root -p password '<password>'



Anschließend wird folgende Befehlskette eingegeben um den weiteren User zu erstellen:

ACHTUNG: <password> mit den entsprechenden Passwort ersetzen.

Translations Ignore


Code Block
languagebash
titleMySQL 8.x - Create and configure server users
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"



MySQL 5.6

ACHTUNG: <password> mit den entsprechenden Passwort ersetzen.

Translations Ignore


Code Block
languagebash
titleMySQL 5.6 - Create and configure server users
mysqladmin -u root password '<password>'
mysql -u root -p<password> -v -e"CREATE USER 'root'@'%' IDENTIFIED 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"



Beide Varianten

Als nächstes wird noch ein zusätzliches Plugin-Modul dem MySQL Server hinzugefügt. Dieses Modul wird ab jtel Software Version 3.06 für die Kommunikation mit weiteren Softwarekomponenten benötigt. Bei Neuinstallationen soll es aber auch dann installiert werden, wenn geplant ist, ältere Revisionen der Software einzuspielen, damit einem späteren Update nichts im Wege steht. Dies erfolgt durch folgende Befehle:

Translations Ignore


Code Block
languagebash
titleInstall UDP Send Plugin - MASTER
cp /home/jtel/shared/JTELCarrierPortal/Libraries/jtel_udf_udpsend/jtel_udf_udpsend.so /usr/lib64/mysql/plugin/
chown root:root /usr/lib64/mysql/plugin/jtel_udf_udpsend.so
chmod 755 /usr/lib64/mysql/plugin/jtel_udf_udpsend.so
chcon system_u:object_r:lib_t:s0  /usr/lib64/mysql/plugin/jtel_udf_udpsend.so



Translations Ignore


Code Block
languagebash
titleInstall UDP Send Plugin - SLAVE
cp /home/jtel/shared/JTELCarrierPortal/Libraries/jtel_udf_udpsend/dummy/jtel_udf_udpsend.so /usr/lib64/mysql/plugin/
chown root:root /usr/lib64/mysql/plugin/jtel_udf_udpsend.so
chmod 755 /usr/lib64/mysql/plugin/jtel_udf_udpsend.so
chcon system_u:object_r:lib_t:s0  /usr/lib64/mysql/plugin/jtel_udf_udpsend.so



Um die zusätzliche Funktion den SQL Prozeduren verfügbar zu machen, muss noch folgender Befehl ausgeführt werden (<password> mit den entsprechenden Passwort ersetzen):

Translations Ignore


Code Block
languagebash
titleRegister the UDP send command
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
titleWichtiger Hinweis

Die oben aufgelisteten SQL Befehle müssen auf einem Datenbankserver ausgeführt werden, bevor er Teil eines Replikationsverbundes wird. Soll das UDP Plugin auf bestehenden DATA-Server nachgerüstet werden, so muss eine andere Vorgehensweise gewählt werden:

  1. Das Modul muss auf allen Server des Verbunden (Sowohl Master als auch Slaves) in das Plugin-Verzeichnis kopiert werden (Siehe Code Block "UDP Send Plugin installieren").
  2. Die Registrierung des Plugins dar nur auf dem Master Server erfolgen. Da der Befehl durch Replikation auch auf den Slaves ausgeführt wird, ist es nicht erforderlich, den Befehl auch dort auszuführen.

ACHTUNG: Wird der Befehl ausgeführt ohne dass das UDP Plugin auf allen Servern des Verbundes vorhanden ist, verursacht dies einen Abbruch der Replikation, der nur durch einen händischen Eingriff repariert werden kann.

Anpassung my.cnf auf RAM des Servers

Damit der Server den zur Verfügung gestellten RAM vollständig nutzt, muss eine Konfiguration angepasst werden mit vi.

Diese Einstellung sollte ca. 3/4 des RAMs des Servers entsprechen, wobei 3-4 GB für mysql und andere Prozesse übrig bleiben sollten.

Translations Ignore


Code Block
languagebash
titlevi /etc/my.cnf.d/jtel-enhanced.cnf
# 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




MySQL Neustart

Als letztes wird der MySQL Server neu gestartet, damit alle Einstellungen übernommen werden:

Translations Ignore


Code Block
languagebash
titleRestart the MySQL server
service mysqld restart




Sv translation
languagefr

Table of Contents
maxLevel3
printablefalse

Composantes fonctionnelles du rôle

Le rôle de DONNÉES peut être réparti sur un ou plusieurs serveurs. Une installation avec un seul serveur DONNÉES n'est recommandée que pour les très petites installations. La division correspond aux composantes fonctionnelles suivantes :

FonctionDescriptionAccèsQuantitéStratégie de redondance
PrimaireTous les accès en écriture se font ici. En outre, toutes les routines fonctionnelles qui modifient les données sont toujours exécutées ici. C'est surtout ici que se fait la distribution des appels.Ecrire et lire1Peut être conçu de manière redondante grâce à une configuration active/passive.
DéclarationCréation d'évaluations de données complexes. Ces opérations nécessitent généralement un niveau élevé de ressources de stockage, de calcul et d'entrées/sorties.Lire0 - nDans les très grands systèmes, différents groupes de serveurs web peuvent être distribués à différents esclaves de reporting. En outre, plusieurs esclaves de reporting peuvent être combinés en un groupe actif/actif

Statistiques en temps réel

Calcul de statistiques en temps réel à intervalles rapprochés pour les utilisateurs ou superviseurs connectés et les panneaux muraux.Lire0 - nDans les très grands systèmes, différents groupes de serveurs web peuvent être distribués à différents esclaves statistiques. En outre, plusieurs esclaves statistiques peuvent être combinés en un groupe actif/actif
Demandes des clientsCréation d'évaluations de données spécifiques aux clients. L'externalisation de cette fonction dans un système séparé sert principalement à protéger le système central.Lire0 - n

Du point de vue de l'installation, ces composants fonctionnels n'ont aucun effet car une version locale (synchronisée) complète de la base de données est stockée sur chaque serveur du réseau. La répartition des fonctions résulte davantage du point de vue des "consommateurs" dans lequel il est possible de configurer quel serveur est accessible pour quelles tâches. Dans le serveur d'application Web, par exemple, il est possible de spécifier séparément la connexion à la base de données pour les zones primaire, de rapport et en temps réel, de sorte qu'il est possible de répartir ces rôles entre différents serveurs.

Le seul aspect de l'installation qui est affecté par la distribution des fonctions est que si vous distribuez les fonctions à différents serveurs, vous devrez construire et configurer une installation de réplication MySQL appropriée. Cela signifie que la fonction "Primary" est forcée de s'exécuter sur un maître de réplication, tandis que toutes les autres fonctions peuvent s'exécuter sur des esclaves de réplication.

Un autre type de configuration très particulier est une configuration spéciale dans laquelle deux serveurs sont connectés dans une réplication maître-maître (qui à son tour peut être utilisée comme maître pour d'autres esclaves). Dans une telle configuration hautement disponible, un seul des maîtres est utilisé comme "primaire". L'autre servirait normalement de réserve passive du cluster HA. Toutefois, il est conseillé d'utiliser cette ressource de manière plus judicieuse en demandant au maître passif d'effectuer soit la fonction "reporting", soit la fonction "statistiques". Les adresses IP liées aux fonctions sont gérées par le responsable de l'AP. Une telle configuration a l'avantage d'offrir un haut degré de disponibilité sans être trop gourmande en ressources.

Common installation steps

Indépendamment de la fonction qu'un serveur DONNÉES doit prendre en charge, les étapes d'installation suivantes doivent d'abord être effectuées à la fois sur le maître et l'esclave.

Relier le zones de données

Connecter la zone de données comme décrit sur la page Connection MAGASIN (Tous les Linux sauf MAGASIN)

Installation du logiciel

Pour inclure les dépôts officiels de logiciels MySQL et installer le serveur MySQL, utilisez les commandes suivantes :

MySQL 8.x 

Translations Ignore


Code Block
languagebash
titleMySQL 8.x
yum -y install libaio yum -y install https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm yum -y install mysql-community-server



 MySQL 5.6

Translations Ignore


Code Block
languagebash
titleMySQL 5,6
yum -y install http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm yum -y install mysql-community-server



Les deux variantes

Le service MySQL Server est ajouté à la liste des services à démarrage automatique et démarré avec la commande suivante :

Translations Ignore


Code Block
languagebash
titleMySQL service autostart
chkconfig mysqld on service mysqld start



Ensuite, les parts de port pour le service de serveur MySQL doivent être saisies et stockées de façon permanente dans le pare-feu :

Translations Ignore


Code Block
languagebash
titleConfigurer le parefeu
firewall-cmd --zone=public --add-port=3306/tcp --permanent firewall-cmd --reload



Pour simplifier la configuration du serveur MySQL, un répertoire est maintenant créé où les fichiers de configuration modulaire peuvent être stockés. Pour qu'ils puissent être chargés à partir du serveur MySQL, une entrée doit être faite dans le fichier de configuration principal. Cela se fait en entrant les commandes suivantes :

Translations Ignore


Code Block
languagebash
titleConfigurer le serveur MySQL
mkdir /etc/mon.cnf.d cat <<EOFF >> /etc/mon.cnf # # * IMPORTANT : Paramètres supplémentaires qui peuvent remplacer ceux de ce fichier ! # Les fichiers doivent se terminer par ".cnf", sinon ils seront ignorés. # !includedir /etc/mon.cnf.d/ EOFF semanage fcontext -a -t mysqld_etc_t "/etc/mon\.cnf\.d(/.*) ?" restorecon -R -v /etc/mon.cnf.d 



Ces commandes créent le répertoire, ajoutent l'instruction de chargement des fichiers de configuration modulaire au fichier de configuration principal, créent une part de sécurité SELINUX pour le nouveau répertoire de configuration et génèrent les étiquettes de sécurité correspondantes.

Ensuite, un fichier de configuration modulaire avec quelques paramètres d'optimisation pertinents commentés est importé.

MySQL 8.x

Translations Ignore


Code Block
languagebash
titleCharger les paramètres de base
wget -P /etc/my.cnf.d http://cdn.jtel.de/downloads/configs/jtel-enhanced-8.cnf



Le fichier /etc/mycnf.d/jtel-enhanced-8.cnf contient un certain nombre d'instructions de configuration bien commentées qui peuvent être utilisées pour optimiser la fonctionnalité du serveur MySQL. La plupart de ces instructions sont commentées. Si nécessaire, ces paramètres doivent être ajustés avec prudence. Cependant, les valeurs par défaut devraient être correctes pour la plupart des installations.

MySQL 5,6

Translations Ignore


Code Block
languagebash
titleCharger les paramètres de base
wget -P /etc/my.cnf.d http://cdn.jtel.de/downloads/configs/jtel-enhanced.cnf




Le fichier /etc/mycnf.d/jtel-enhanced.cnf contient un certain nombre d'instructions de configuration bien commentées qui peuvent être utilisées pour optimiser la fonctionnalité du serveur MySQL. La plupart de ces instructions sont commentées. Si nécessaire, ces paramètres doivent être ajustés avec prudence. Cependant, les valeurs par défaut devraient être correctes pour la plupart des installations.

Les deux variantes

Maintenant, le serveur MySQL doit être redémarré :

Translations Ignore


Code Block
languagebash
titleDmarrer le serveur MySQL
service mysqld restart



Après le premier démarrage du serveur MySQL, les données d'accès pour l'utilisateur root doivent maintenant être définies.

Comme dans MySQL, un compte utilisateur ne se compose pas seulement d'un nom d'utilisateur mais aussi d'une adresse d'origine de la connexion, un autre utilisateur root doit être créé pour se connecter à partir de n'importe quelle adresse d'origine. 

MySQL 8.x

MySQL 8.x stocke un mot de passe généré pour l'utilisateur root dans le fichier /var/log/mysqld.log

Ce mot de passe doit d'abord être extrait. Comme il contient souvent des caractères spéciaux qui ne peuvent pas être facilement saisis dans la ligne de commande, le premier ajustement est effectué en saisissant le mot de passe manuellement.

Translations Ignore


Code Block
languagebash
titleMySQL 8.x - Créer et configurer les utilisateurs du serveur
mysqladmin -u root -p password '<password>'



Ensuite, la chaîne de commande suivante est saisie pour créer l'utilisateur supplémentaire :

ATTENTION : remplacer <password> par le mot de passe correspondant.

Translations Ignore


Code Block
languagebash
titleMySQL 8.x - Créer et configurer les utilisateurs du serveur
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"



MySQL 5,6

ATTENTION : remplacer <password> par le mot de passe correspondant.

Translations Ignore


Code Block
languagebash
titleMySQL 5,6 - Créer et configurer les utilisateurs du serveur
mysqladmin -u root password '<password>' mysql -u root -p<password> -v -e"CREATE USER 'root'@'%' IDENTIFIED 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"



Les deux variantes

Ensuite, un module de plugin supplémentaire est ajouté au serveur MySQL. Ce module est requis à partir de la version 3,06 du logiciel jtel pour la communication avec d'autres composants logiciels. Pour les nouvelles installations, il doit également être installé s'il est prévu d'installer d'anciennes révisions du logiciel, afin que rien n'entrave une mise à jour ultérieure. Cela se fait avec les commandes suivantes :

Translations Ignore


Code Block
languagebash
titleInstaller UDP Send Plugin - MAÎTRE
cp /home/jtel/shared/JTELCarrierPortal/Libraries/jtel_udf_udpsend/jtel_udf_udpsend.so /usr/lib64/mysql/plugin/ chown root:root /usr/lib64/mysql/plugin/jtel_udf_udpsend.so chmod 755 /usr/lib64/mysql/plugin/jtel_udf_udpsend.so chcon system_u:object_r:lib_t:s0 /usr/lib64/mysql/plugin/jtel_udf_udpsend.so



Translations Ignore


Code Block
languagebash
titleInstaller UDP Send Plugin - ESCLAVE
cp /home/jtel/shared/JTELCarrierPortal/Libraries/jtel_udf_udpsend/dummy/jtel_udf_udpsend.so /usr/lib64/mysql/plugin/ chown root:root /usr/lib64/mysql/plugin/jtel_udf_udpsend.so chmod 755 /usr/lib64/mysql/plugin/jtel_udf_udpsend.so chcon system_u:object_r:lib_t:s0 /usr/lib64/mysql/plugin/jtel_udf_udpsend.so



Pour mettre la fonction supplémentaire à la disposition des procédures SQL, la commande suivante doit être exécutée (remplacer <password> par le mot de passe correspondant) :

Translations Ignore


Code Block
languagebash
titleEnregistrer la commande UDP send
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
titleNote importante

Les commandes SQL énumérées ci-dessus doivent être exécutées sur un serveur de base de données avant qu'elle fait partie d'un groupe de réplication. Si le plugin UDP doit être installé ultérieurement sur des serveurs de données existants, une procédure différente doit être choisie :

  1. Le module doit être copié dans le répertoire des plugins sur tous les serveurs du groupe (à la fois maître et esclaves) (voir le bloc de code "Installer le plugin UDP send")
  2. Le plugin ne peut être enregistré que sur le serveur maître. Étant donné que la commande est également exécutée sur les esclaves par réplication, il n'est pas nécessaire d'exécuter la commande là aussi.

ATTENTION: Si la commande est exécutée sans que le plugin UDP soit présent sur tous les serveurs du réseau, la réplication est interrompue et ne peut être réparée que par une intervention manuelle.

Adaptation de mon .cnf à la RAM du serveur

Pour que le serveur puisse utiliser pleinement la mémoire vive fournie, une configuration doit être ajustée avec vi.

Ce réglage devrait représenter environ 3/4 de la mémoire vive du serveur, mais laisse 3-4 Go pour mysql et d'autres processus.

Translations Ignore


Code Block
languagebash
titlevi /etc/my.cnf.d/jtel-enhanced.cnf
# 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




Redémarrer MYSQL

Enfin, le serveur MySQL est redémarré afin que tous les paramètres soient appliqués :

Translations Ignore


Code Block
languagebash
titleRedémarrer le serveur MySQL
service mysqld restart