Dual Site HA PSC – Parte 1b

 

Installazione Load Balancer Site 1 e Site 2

Riprendiamo la parte 1a del setup dei bilanciatori

Nella seguente procedura verrà mostrato solo il setup del Site 1, il Site 2 è speculare ad eccezione degli IP e degli FQDN dei Load Balancer.

Site 1
LB#1           lb-s1-01.nvlabs.local         192.168.10.6
LB#2           lb-s1-02.nvlabs.local         192.168.10.7
PSC VIP      lb-psc-s1-01.nvlabs.local  192.168.10.8

Site 2
LB#1           lb-s2-01.nvlabs.local         192.168.20.6
LB#2           lb-s2-02.nvlabs.local         192.168.20.7
PSC VIP      lb-psc-s2-01.nvlabs.local  192.168.20.8

I quatro server CentOS che diventeranno i Load Banacer sono stati installati in modalità minimal ed è stato disabilitato il SElinux.

 

Stoppiamo temporaneamente il resource group LB-Cluster-Group per effettuare il setup finale del LB con le porte necessarie ai PSC
[root@lb-s1-01 ~]# pcs resource disable LB-Cluster-Group

[root@lb-s1-01 ~]# pcs resource
Resource Group: LB-Cluster-Group
LB-VIP01 (ocf::heartbeat:IPaddr2): Stopped (disabled)
HAProxy_Srv (systemd:haproxy): Stopped (disabled)

 

Prepariamo la configurazione di haproxy per i psc (porte 80, 443, 389, 636, 2012, 2014 & 2020).
Verrà abilitiata sulla porta 80 del VIP una url http://192.168.X0.8/stats dove verranno mostrate le statistiche del LB

[root@lb-s1-01 ~]# vi /etc/haproxy/haproxy.cfg
#———————————————————————
# Example configuration for a possible web application. See the
# full configuration options online.
#
# http://haproxy.1wt.eu/download/1.4/doc/configuration.txt
#
#———————————————————————

#———————————————————————
# Global settings
#———————————————————————
global
# to have these messages end up in /var/log/haproxy.log you will
# need to:
#
# 1) configure syslog to accept network log events. This is done
# by adding the ‘-r’ option to the SYSLOGD_OPTIONS in
# /etc/sysconfig/syslog
#
# 2) configure local2 events to go to the /var/log/haproxy.log
# file. A line like the following can be added to
# /etc/sysconfig/syslog
#
# local2.* /var/log/haproxy.log
#
log 127.0.0.1 local2

chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
maxconn 4000
user haproxy
group haproxy
daemon
# turn on stats unix socket
stats socket /var/lib/haproxy/stats

#———————————————————————
# common defaults that all the ‘listen’ and ‘backend’ sections will
# use if not designated in their block
#———————————————————————
defaults
# mode http
log global
# option httplog
option dontlognull
option http-server-close
option forwardfor except 127.0.0.0/8
option redispatch
retries 3
timeout http-request 10s
timeout queue 1m
timeout connect 10s
timeout client 30m
timeout server 30m
timeout http-keep-alive 10s
timeout check 10s
maxconn 3000

listen 80 192.168.10.8:80
mode http
stats enable
stats uri /stats
stats realm Strictly\ Private
stats auth admin:VMware123!
balance source
option httplog
option httpclose
option forwardfor
server psc-s1-01 192.168.10.11:80 check
server psc-s1-02 192.168.10.12:80 check

listen 389 192.168.10.8:389
mode tcp
balance source
option tcplog
server psc-s1-01 192.168.10.11:389 check
server psc-s1-02 192.168.10.12:389 check

listen 636 192.168.10.8:636
mode tcp
balance source
option tcplog
server psc-s1-01 192.168.10.11:636 check
server psc-s1-02 192.168.10.12:636 check

listen 2012 192.168.10.8:2012
mode tcp
balance source
option tcplog
server psc-s1-01 192.168.10.11:2012 check
server psc-s1-02 192.168.10.12:2012 check

listen 2014 192.168.10.8:2014
mode tcp
balance source
option tcplog
server psc-s1-01 192.168.10.11:2014 check
server psc-s1-02 192.168.10.12:2014 check

listen 2020 192.168.10.8:2020
mode tcp
balance source
option tcplog
server psc-s1-01 192.168.10.11:2020 check
server psc-s1-02 192.168.10.12:2020 check

frontend https_frontend
bind 192.168.10.8:443
mode tcp
default_backend web_server

backend web_server
mode tcp
balance source
stick-table type binary len 32 size 30k expire 30m

acl clienthello req_ssl_hello_type 1
acl serverhello rep_ssl_hello_type 2

tcp-request inspect-delay 2s
tcp-request content accept if clienthello

tcp-response content accept if serverhello
stick on payload_lv(43,1) if clienthello
stick store-response payload_lv(43,1) if serverhello

server psc-s1-01 192.168.10.11:443 check
server psc-s1-02 192.168.10.12:443 check

 

Fonte per la configurazione della porta 443
http://virtuallyhyper.com/2013/05/configure-haproxy-to-load-balance-sites-with-ssl/

 

Copiamo il file di conf di haproxy dal nodo 01 al nodo 02
[root@lb-s1-01 ~]# scp -p /etc/haproxy/haproxy.cfg 192.168.80.12:/etc/haproxy/haproxy.cfg
haproxy.cfg 100% 2514 2.5KB/s 00:00

 

Facciamo partire il servizio Cluster con haproxy configurato.
[root@lb-s1-01 ~]# pcs resource enable LB-Cluster-Group
[root@lb-s1-01 ~]# pcs resource
Resource Group: LB-Cluster-Group
LB-VIP01 (ocf::heartbeat:IPaddr2): Started lb-s1-01
HAProxy_Srv (systemd:haproxy): Started lb-s1-01

 

Effettuiamo dei check sulle porte dei servizi necessari ai PSC (sul nodo che ha il servizio in carico)
[root@lb-s1-01 ~]# netstat -an | egrep -w “80|443|389|636|2012|2014|2020”
tcp 0 0 192.168.10.8:80 0.0.0.0:* LISTEN
tcp 0 0 192.168.10.8:443 0.0.0.0:* LISTEN
tcp 0 0 192.168.10.8:389 0.0.0.0:* LISTEN
tcp 0 0 192.168.10.8:636 0.0.0.0:* LISTEN
tcp 0 0 192.168.10.8:2012 0.0.0.0:* LISTEN
tcp 0 0 192.168.10.8:2014 0.0.0.0:* LISTEN
tcp 0 0 192.168.10.8:2020 0.0.0.0:* LISTEN

 


 

Dual Site HA PSC – Intro
Installazione Load Balancer Site 1 e Site 2 – Parte 1a
Installazione Load Balancer Site 1 e Site 2 – Parte 1b
Installazione psc-s1-01 e psc-s1-02 – Parte 2
Creazione certificati Site 1 e Site 2 – Parte 3
Installazione nuovi certificati PSC Site 1  – Parte 4
Installazione psc-s2-01 e psc-s2-02 – Parte 5
Installazione vCenter Site 1 e 2 e bind verso vip PSC Site 1 e 2 – Parte 6
Configurazione PSC in modalità Ring topology fra i 2 site – Parte 7

Ben Kenobi

Rispondi

Inserisci i tuoi dati qui sotto o clicca su un'icona per effettuare l'accesso:

Logo di WordPress.com

Stai commentando usando il tuo account WordPress.com. Chiudi sessione /  Modifica )

Foto di Facebook

Stai commentando usando il tuo account Facebook. Chiudi sessione /  Modifica )

Connessione a %s...