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

Master Servers

The following steps configure the master servers, and are performed on both master servers.

First of all, a configuration file is created on each server.

Warning

CAUTION - if you make modifications to the configuration:

  • The server_id must be unique per server. 
  • The Parameter auto_increment_offset must be different for each master.

Configure Master 1

Translations Ignore


Code Block
languagebash
cat <<EOFF > /etc/my.cnf.d/jtel-master.cnf
# Custom MySQL settings for a specific SQL master server
#
# WARNING: This file is specific to the master server

[mysqld]
#
# Replication Options
#

# Specific options for MASTER role
#
server_id                       = 1
binlog_format                   = ROW
expire_logs_days                = 1
max_binlog_size                 = 100M
log_bin                         = binlog
auto_increment_increment        = 2
auto_increment_offset           = 1
log_slave_updates
relay_log                       = mysqld-relay-bin
relay_log_index                 = mysqld-relay-bin.index
relay_log_info_file             = relay-log.info
EOFF


Configure Master 2

Translations Ignore


Code Block
languagebash
cat <<EOFF > /etc/my.cnf.d/jtel-master.cnf
# Custom MySQL settings for a specific SQL master server
#
# WARNING: This file is specific to the master server

[mysqld]
#
# Replication Options
#

# Specific options for MASTER role
#
server_id                       = 2
binlog_format                   = ROW
expire_logs_days                = 1
max_binlog_size                 = 100M
log_bin                         = binlog
auto_increment_increment        = 2
auto_increment_offset           = 2
log_slave_updates
relay_log                       = mysqld-relay-bin
relay_log_index                 = mysqld-relay-bin.index
relay_log_info_file             = relay-log.info
EOFF


Replication User

Next, a replication user is created, which is used to connect to the master servers.

Status
colourRed
titleCaution Password

Translations Ignore


Code Block
mysql -u root -p<password> -v -e"CREATE USER 'repl'@'%' IDENTIFIED BY '<password>'"
mysql -u root -p<password> -v -e"GRANT REPLICATION SLAVE ON *.* TO 'repl'@'%'"
mysql -u root -p<password> -v -e"FLUSH PRIVILEGES"


Slave Servers

The following steps configure the slave servers, and are performed on both slave servers. 

First of all, a configuration file is created on each server.

Warning

CAUTION - if you make modifications to the configuration:

  • The server_id must be unique per server. 

Configure Slave 1

Translations Ignore


Code Block
languagebash
cat <<EOFF > /etc/my.cnf.d/jtel-slave.cnf
# Custom MySQL settings for a specific SQL slave server
#
# WARNING: This file is specific to the slave server

[mysqld]
# Specific options for SLAVE role
#
server_id                       = 101
relay_log                       = mysqld-relay-bin
relay_log_index                 = mysqld-relay-bin.index
relay_log_info_file             = relay-log.info
skip-log-bin
EOFF


Configure Slave 2

Translations Ignore


Code Block
languagebash
cat <<EOFF > /etc/my.cnf.d/jtel-slave.cnf
# Custom MySQL settings for a specific SQL slave server
#
# WARNING: This file is specific to the slave server

[mysqld]
# Specific options for SLAVE role
#
server_id                       = 102
relay_log                       = mysqld-relay-bin
relay_log_index                 = mysqld-relay-bin.index
relay_log_info_file             = relay-log.info
skip-log-bin
EOFF


Restart MySQL Servers

Next, all 4 mysql servers are restarted, to reload the configuration.

Translations Ignore


Code Block
languagebash
systemctl restart mysqld.service



Sv translation
languagede

Status
colourRed
titleThis page is only available in English

Sv translation
languagefr

Serveurs Maîtres

Les étapes suivantes permettent de configurer les serveurs maîtres, et sont effectuées sur les deux serveurs maîtres.

Tout d'abord, un fichier de configuration est créé sur chaque serveur.

Warning

ATTENTION - si vous apportez des modifications à la configuration :

  • Le server_id doit être unique par serveur. 
  • Le paramètre auto_increment_offset doit être différent pour chaque maître.

Configurer le Maître 1

Table of Contents
maxLevel3
printablefalse

Master Server (Primary)

Folgende Schritte sind erforderlich, um einen DATA Server als Master zu konfigurieren.

Als erstes muss ein entsprechendes Konfigurationsmodul erstellt werden. Dies erfolgt mit folgendem Befehl.

ACHTUNG:

  • die server_id sind pro Master Server unterschiedlich 
  • Der Parameter auto_increment_offset ist pro Master Server unterschiedlich

    Translations Ignore


    Code Block
    languagebashtitleConfigure MySQL Master 1
    cat <<EOFF > /etc/mymon.cnf.d/jtel-master.cnf
     # CustomParamètres MySQL settingspersonnalisés forpour aun specificserveur SQL mastermaître spécifique server
    #
     # WARNINGATTENTION : ThisCe filefichier isest specificspécifique toau theserveur mastermaître server
    
    [mysqld]
     #
     # Replication Options
    #
    
    # Specificde optionsréplication for# MASTER role
    #
    server_id Options spécifiques pour le rôle MASTER                 # server_id = 1
     binlog_format                   = ROW
     expire_logs_days                = 1
     max_binlog_size                 = 100M
     log_bin                         = binlog
     auto_increment_increment        = 2
     auto_increment_offset           = 1
     log_slave_updates
    relay_log                       = mysqld-relay-bin
    sldq-relay-mysupdates -bin relay_log_index                 = mysqld-relay-bin.index
     relay_log_info_file             = relay-log.info
     EOFF


    Configurer le Maître 2

    Translations Ignore


    Code Block
    languagebash
    titleConfigure MySQL Master 2
    cat <<EOFF > /etc/mymon.cnf.d/jtel-master.cnf
     # CustomParamètres MySQL settingspersonnalisés forpour aun specificserveur SQL maître masterspécifique server
    #
     # WARNINGATTENTION : ThisCe filefichier isest specificspécifique toau theserveur mastermaître server
    
    [mysqld]
     #
     # Replication Options
    #
    
    # Specificde optionsréplication for MASTER# role
    #
    server_id Options spécifiques pour le rôle MASTER                 # server_id = 2
     binlog_format                   = ROW
     expire_logs_days                = 1
     max_binlog_size                 = 100M
     log_bin                         = binlog
     auto_increment_increment        = 2
     auto_increment_offset           = 2
     log_slave_updates
    relay_log                       = mysqld-relay-bin
    sldq-relay-mysupdates -bin relay_log_index                 = mysqld-relay-bin.index
     relay_log_info_file             = relay-log.info
     EOFF

    Als nächstes wird ein Benutzer angelegt, mit dem sich die Slave-Server mit dem Master-Server verbinden können - <password> mit dem entsprechenden Passwort ersetzen.


    Utilisateur de réplication

    Ensuite, un utilisateur de réplication est créé, qui est utilisé pour se connecter aux serveurs maîtres.

    Status
    colourRed
    titleMot de passe de précaution

    Translations Ignore


    Code Block
    titleCreate replication user
    mysql -u root -p<password> -v -e"CREATE USER 'repl'@'%' IDENTIFIED BY '<password>'"
     mysql -u root -p<password> -v -e"GRANT REPLICATION SLAVE ON *.* TO 'repl'@'%'"
     mysql -u root -p<password> -v -e"FLUSH PRIVILEGES"

    Im Anschluss muss der MySQL-Server neu gestartet werden, damit alle Einstellungen übernommen werden:

    Translations Ignore
    Code Block
    languagebash
    titleRestart the MySQL server
    service mysqld restart


    Serveurs d'esclaves

    Les étapes suivantes permettent de configurer les serveurs esclaves, et sont effectuées sur les deux serveurs esclaves. 

    Tout d'abord, un fichier de configuration est créé sur chaque serveur.

    Warning

    ATTENTION - si vous apportez des modifications à la configuration :

    • Le server_id doit être unique par serveur. 

    Configurer Esclave 1

    Slave Server

    Folgende Schritte sind erforderlich, um einen DATA-Server als Slave zu konfigurieren. Es handelt sich hierbei um eine unverschlüsselte Replikation. Eine verschlüsselte Replikation kann gemäß https://www.thomas-krenn.com/de/wiki/MySQL_Verbindungen_mit_SSL_verschl%C3%BCsseln umgesetzt werden.

    Als erstes muss ein entsprechendes Konfigurationsmodul erstellt werden. Dies erfolgt mit folgendem Befehl.

    ACHTUNG:

    • die server_id sind pro Slave Server unterschiedlich, und sind bewusst abseits von 100 gehalten, damit die nicht mit Master-IDs kollidieren.
    Translations Ignore


    Code Block
    languagebashtitleConfigure MySQL Slave 1
    cat <<EOFF > /etc/mymon.cnf.d/jtel-slave.cnf
     # CustomParamètres MySQL settingspersonnalisés forpour aun specificserveur SQL slaveesclave spécifique server
    #
     # WARNINGATTENTION : ThisCe filefichier isest specificspécifique toau theserveur slaveesclave server
    
    [mysqld]
     # Options Specificspécifiques pour optionsle forrôle SLAVE role
    #
     server_id                       = 101
     relay_log                       = mysqld-relay-bin
     relay_log_index                 = mysqld-relay-bin.index
     relay_log_info_file             = relay-log.info
     skip-log-bin
     EOFF


    Configurer Esclave 2

    Translations Ignore


    Code Block
    languagebashtitleConfigure MySQL Slave 2
    cat <<EOFF > /etc/mymon.cnf.d/jtel-slave.cnf
     # CustomParamètres MySQL settingspersonnalisés forpour aun specificserveur SQL esclave slavespécifique server
    #
     # WARNINGATTENTION : ThisCe filefichier isest specificspécifique toau theserveur slaveesclave server
    
    [mysqld]
     # Specific options forOptions spécifiques pour le rôle SLAVE role
    #
     server_id                       = 102
     relay_log                       = mysqld-relay-bin
     relay_log_index                 = mysqld-relay-bin.index
     relay_log_info_file             = relay-log.info
     skip-log-bin
     EOFF


    Redémarrez les serveurs MySQL

    Ensuite, les 4 serveurs mysql sont redémarrés, pour recharger la configuration.Im Anschluss muss der MySQL-Server neu gestartet werden, damit alle Einstellungen übernommen werden:

    Translations Ignore


    Code Block
    languagebash
    titleRestart the MySQL server
    service mysqld restartsystemctl restart mysqld.service