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

PCS Cluster Installation

Next, PCS Cluster is installed, see Redundancy - Installing PCS Cluster.

Configure virtual IP address (only on one node!)

Then, the virtual IP address of the cluster is configured as a resource:

Translations Ignore


Code Block
titleConfigure virtual IP address
pcs resource create ClusterIP ocf:heartbeat:IPaddr2 ip=10.4.8.12 cidr_netmask=32 op monitor interval=30s



Check whether the address is started:

Translations Ignore


Code Block
titleCheck virtual IP address
pcs status
 
# It may take a few seconds before the resource is started. Run this command more than once...
 
-->
 
Cluster name: portal
Stack: corosync
Current DC: uk-acd-lb1 (version 1.1.16-12.el7_4.8-94ff4df) - partition with quorum
Last updated: Tue Mar 20 11:57:43 2018
Last change: Tue Mar 20 11:57:33 2018 by root via cibadmin on uk-acd-lb1

2 nodes configured
1 resource configured

Online: [ uk-acd-lb1 uk-acd-lb2 ]

Full list of resources:

 ClusterIP      (ocf::heartbeat:IPaddr2):       Started uk-acd-lb1

Daemon Status:
  corosync: active/enabled
  pacemaker: active/enabled
  pcsd: active/enabled



Firewall configuration

Next, the port shares for the mySQL forwarding must be entered in the firewall and saved permanently:

Translations Ignore


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



haproxy configuration for redundancy (both nodes)

The structure of the configuration file of the haproxy service is quite complex. For this reason it is recommended to use an appropriate template from the central jtel download directory to speed up the configuration work. There are two templates, which differ in whether the services are offered via HTTP or via HTTPS. If provision via HTTPS is desired, a file with a valid certificate and the corresponding private key in PEM-base64-- format must be provided in addition to the configuration file.

Downloading the following configuration template is a good starting point for a system that should be accessible via HTTP:

Translations Ignore


Code Block
languagebash
titleDownload the HTTP configuration template
curl https://cdn.jtel.de/downloads/configs/haproxy.redundant.http.cfg > /etc/haproxy/haproxy.cfg



If, on the other hand, it is desired that HTTP accesses are automatically redirected to HTTPS and all accesses are to take place via HTTPS, the following configuration template must be downloaded:

Translations Ignore


Code Block
languagebash
titleDownload the HTTPS configuration template
curl https://cdn.jtel.de/downloads/configs/haproxy.redundant.https.cfg > /etc/haproxy/haproxy.cfg



If the configuration supports HTTPS, the file /etc/haproxy/haproxy.pem must also be created, which contains the certificate, any secondary certificates and the private key. This file must also be given special permissions so that only the root user has read access, otherwise the haproxy service will not start.

For self-generated certificates see Role LB SSL/TLS Certificates - Self-signed certificate.

Translations Ignore


Code Block
languagebash
titleSave the certificate file
chmod 400 /etc/haproxy/haproxy.pem





Sv translation
languagede

Table of Contents
maxLevel3
printablefalse

PCS Cluster Installation

Als nächstes, wird PCS Cluster installiert, siehe Redundancy - Installing PCS Cluster.

Virtuelle IP Adresse konfigurieren (Nur auf einem Node!)

Anschließend, wird die virtuelle IP Adresse des Clusters als Ressource konfiguriert:

Translations Ignore


Code Block
titleConfigure virtual IP address
pcs resource create ClusterIP ocf:heartbeat:IPaddr2 ip=10.4.8.12 cidr_netmask=32 op monitor interval=30s



Prüfen, ob die Adresse gestartet wird:

Translations Ignore


Code Block
titleCheck virtual IP address
pcs status
 
# It may take a few seconds before the resource is started. Run this command more than once...
 
-->
 
Cluster name: portal
Stack: corosync
Current DC: uk-acd-lb1 (version 1.1.16-12.el7_4.8-94ff4df) - partition with quorum
Last updated: Tue Mar 20 11:57:43 2018
Last change: Tue Mar 20 11:57:33 2018 by root via cibadmin on uk-acd-lb1

2 nodes configured
1 resource configured

Online: [ uk-acd-lb1 uk-acd-lb2 ]

Full list of resources:

 ClusterIP      (ocf::heartbeat:IPaddr2):       Started uk-acd-lb1

Daemon Status:
  corosync: active/enabled
  pacemaker: active/enabled
  pcsd: active/enabled



Firewall Konfiguration

Als nächstes müssen in der Firewall die Port-Freigaben für die mySQL Weiterleitungen eingetragen und persistent gespeichert werden:

Translations Ignore


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



haproxy Konfiguration für Redundanz (beide Nodes)

Der Aufbau der Konfigurationsdatei des haproxy Dienstes ist recht komplex. Aus diesem Grunde empfiehlt es sich eine entsprechende Vorlage aus dem zentralen jtel Download-Verzeichnis anzuwenden, um die Konfigurationsarbeiten zu beschleunigen. Dort befinden sich zwei Vorlagen, die sich darin unterscheiden, ob die Dienste über HTTP oder über HTTPS angeboten werden. Ist die Bereitstellung über HTTPS gewünscht, muss zusätzlich zu der Konfigurationsdatei auch eine Datei mit einem gültigen Zertifikat und dem dazugehörigen Private Key im PEM-base64--Format zur Verfügung gestellt werden.

Das Herunterladen der folgenden Konfigurationsvorlage ist ein guter Startpunkt für ein System welches über HTTP erreichbar sein soll:

Translations Ignore


Code Block
languagebash
titleDownload the HTTP configuration template
curl https://cdn.jtel.de/downloads/configs/haproxy.redundant.http.cfg > /etc/haproxy/haproxy.cfg



Ist hingegen gewünscht, dass HTTP Zugriffe automatisch auf HTTPS umgeleitet werden und alle Zugriffe über HTTPS erfolgen sollen, so ist folgende Konfigurationsvorlage herunterzuladen:

Translations Ignore


Code Block
languagebash
titleDownload the HTTPS configuration template
curl https://cdn.jtel.de/downloads/configs/haproxy.redundant.https.cfg > /etc/haproxy/haproxy.cfg



Im Falle einer Konfiguration die HTTPS Unterstützt, muss zusätzlich die Datei /etc/haproxy/haproxy.pem angelegt werden, in der sich sowohl das Zertifikat, eventuelle Zwischenzertifikate und der Private Schlüssel befindet. Diese Datei muss außerdem eine spezielle Berechtigung erhalten, damit nur der Benutzer root darauf lesen zugreifen kann, ansonsten wird der haproxy Dienst nicht starten.

Für selbstgenerierte Zertifikate siehe Role LB SSL/TLS Certificates - Self-signed certificate.

Translations Ignore


Code Block
languagebash
titleSave the certificate file
chmod 400 /etc/haproxy/haproxy.pem





Sv translation
languagefr

Table of Contents
maxLevel3
printablefalse

Installation du PCS Cluster

Ensuite, le PCS Cluster est installé, voir Redundancy - Installing PCS Cluster.

Configurer l'adresse IP virtuelle (uniquement sur un nœud !)

Ensuite, l'adresse IP virtuelle du cluster est configurée comme une ressource :

Translations Ignore


Code Block
titleConfigurer l'adresse IP virtuelle
pcs resource create ClusterIP ocf:heartbeat:IPaddr2 ip=10.4.8.12 cidr_netmask=32 op monitor interval=30s



Vérifiez si l'adresse est lancée :

Translations Ignore


Code Block
titleVérifiez l'adresse IP virtuelle
pcs status # Il peut s'écouler quelques secondes avant que la ressource ne soit lancée. Exécutez cette commande plus d'une fois...   --> Nom du cluster : portal Stack : corosync Current DC : uk-acd-lb1 (version 1.1.16-12.el7_4.8-94ff4df) - partition avec quorum Dernière mise à jour : Mardi 20 Mar 11:57:43 2018 Dernier changement: Mardi 20 Mar 11:57:33 2018 par root via cibadmin sur uk-acd-lb1 2 noeuds configurés 1 ressource configurée en ligne : [ uk-acd-lb1 uk-acd-lb2 ] Liste complète des ressources : ClusterIP (ocf::heartbeat:IPaddr2): Started uk-acd-lb1 Daemon Status: corosync: active/enabled pacemaker: active/enabled pcsd: active/enabled



Configuration du pare-feu

Ensuite, les partages de port pour la redirection mySQL doivent être saisis dans le pare-feu et enregistrés de manière permanente :

Translations Ignore


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



configuration haproxy pour la redondance (les deux nœuds)

La structure du fichier de configuration du service haproxy est assez complexe. Pour cette raison, il est recommandé d'utiliser un modèle approprié du répertoire central de téléchargement de jtel pour accélérer le travail de configuration. Il existe deux modèles, qui diffèrent selon que les services sont offerts via HTTP ou via HTTPS. Si la fourniture via HTTPS est souhaitée, un fichier avec un certificat valide et la clé privée correspondante au format PEM-base64-- doit être fourni en plus du fichier de configuration.

Le téléchargement du modèle de configuration suivant est un bon point de départ pour un système qui devrait être accessible via HTTP :

Translations Ignore


Code Block
languagebash
titleTélécharger le modèle de configuration HTTP
curl https://cdn.jtel.de/downloads/configs/haproxy.redundant.http.cfg > /etc/haproxy/haproxy.cfg



Si, en revanche, on souhaite que les accès HTTP soient automatiquement redirigés vers HTTPS et que tous les accès se fassent via HTTPS, le modèle de configuration suivant doit être téléchargé :

Translations Ignore


Code Block
languagebash
titleTélécharger le modèle de configuration HTTPS
curl https://cdn.jtel.de/downloads/configs/haproxy.redundant.https.cfg > /etc/haproxy/haproxy.cfg



Si la configuration supporte le HTTPS, le fichier /etc/haproxy/haproxy.pem doit également être créé, qui contient le certificat, les éventuels certificats secondaires et la clé privée. Ce fichier doit également être doté de permissions spéciales afin que seul l'utilisateur root ait un accès en lecture, sinon le service haproxy ne démarrera pas.

Pour les certificats autogénérés, voir Role LB SSL/TLS Certificates - Self-signed certificate.

Translations Ignore


Code Block
languagebash
titleEnregistrer le fichier de certificat
chmod 400 /etc/haproxy/haproxy.pem