Adresse IP virtuelle haute disponibilité avec keepalived

Intermédiaire LinuxKeepalived (VRRP)25 min50 XP

Deux répartiteurs HAProxy (lb-01 et lb-02) doivent partager l'adresse de service 10.0.10.100/24 : si lb-01 ou son HAProxy tombe, lb-02 la reprend.

Exigences — /etc/keepalived/keepalived.conf sur lb-01 :

  • vrrp_script chk_haproxy : script "/usr/bin/pgrep haproxy", interval 2, weight -30
  • vrrp_instance VI_WEB : state MASTER, interface eth0, virtual_router_id 51, priority 150, advert_int 1, authentification auth_type PASS / auth_pass Vrrp2026, virtual_ipaddress 10.0.10.100/24, track_script chk_haproxy

Question : lb-02 a la priorité 120. Si HAProxy s'arrête sur lb-01, quelle priorité effective aura lb-01 ? → answer priorite <n> ; qui porte alors la VIP ? → answer vip <lb-01|lb-02>

Contenu Premium

Ce contenu est inclus dans l'offre Premium. Le titre et le résumé restent visibles pour vous aider à choisir.

Tâches

  1. Surveillance de HAProxy
  2. Instance VRRP
  3. keepalived démarré
  4. Bascule comprise