vrrp_script chk_dienst { #script "/usr/bin/pgrep mysqld" # MySQL-DB prüfen #script "killall -0 /usr/sbin/mysqld" # MySQL-DB prüfen script "/root/bin/check_db.sh $(hostname -s) 3306 checkuser geheim" # MySQL-DB prüfen interval 2 # Alle 2 Sekunden prüfen weight 2 # 2 Punkte hinzufügen wenn OK fall 2 rise 2 } vrrp_instance meine_mysql_db { interface eth0 # Zu überwachendes Interface state BACKUP priority 100 virtual_router_id 123 # ID der Route virtual_ipaddress { 10.10.10.10 # Die virtuelle IP Adresse } track_script { chk_dienst } unicast_src_ip 10.10.10.97 # eigene IP (Knoten 1) unicast_peer { 10.10.10.98 # IP von Knoten 2 10.10.10.99 # IP von Knoten 3 } authentication { auth_type PASS auth_pass geheim_1234 } # for ANY state transition. # "notify" script is called AFTER the # notify_* script(s) and is executed # with 3 arguments provided by keepalived # (ie dont include parameters in the notify line). # arguments # $1 = "GROUP"|"INSTANCE" # $2 = name of group or instance # $3 = target state of transition # ("MASTER"|"BACKUP"|"FAULT") notify /root/bin/keepalived_notify.sh }