Re: Keepalived track_script and failover

Thomas Heil <[email protected]>
Newsgroups gmane.linux.keepalived.devel
Message-ID <[email protected]>
Hi,

This is easy.

you habe prio 150 on host 1 and prio 100 on host 2. So with weight 2 for
chk_haproxy you should
now get 150+2 on host 1 and 100+2. So I would prefer

host 1 prio 50 +2 = 52
host 2 prop 49 +2 = 51

if haproxy fails on host 1, host 2 wins.
if haproxy failes on host 2, host 1 wins.

Maybe that could solve your problem, except you dont have a firewall issue.
cheers,
thomas

On 15.07.2013 18:50, Sheldon Lee-Wen wrote:
>
> Hello,
>
>  
>
> Please forgive me if this is a dumb question, but being new to
> keepalived I need some help. If this is not the correct place to ask,
> please let me know where I should go for help.
>
>  
>
> I have keepalived setup between two servers that run haproxy. When
> haproxy stops running on one host, the  track_script fails (as it
> shows in the log) but keepalived does not fail the virtual IP
> addresses over to the other host. My expectation was that it would
> failover to the other host. What am I missing?
>
>  
>
> Here are the config files for both keepalived hosts:
>
>  
>
> Host1:
>
>  
>
> global_defs {
>
>     notification_email {
>
>         <removed>
>
>     }
>
>     notification_email_from <removed>
>
>     smtp_server <removed>
>
>     smtp_connect_timeout 30
>
> }
>
>  
>
> vrrp_script chk_haproxy {
>
>     script "killall -0 haproxy"
>
>     interval 1
>
>     weight 2
>
> }
>
>  
>
> vrrp_instance VI_1 {
>
>     interface eth0
>
>     state MASTER
>
>     virtual_router_id 51
>
>     priority 150
>
>  
>
>     smtp_alert
>
>  
>
>     authentication {
>
>        auth_type PASS
>
>        auth_pass 1234qwer
>
>     }
>
>  
>
>     virtual_ipaddress {
>
>         192.168.12.5
>
>         192.168.12.10
>
>     }
>
>  
>
>     track_script {
>
>        chk_haproxy
>
>     }
>
> }
>
>  
>
> Host2:
>
> global_defs {
>
>     notification_email {
>
>         <removed>
>
>     }
>
>     notification_email_from <removed>
>
>     smtp_server <removed>
>
>     smtp_connect_timeout 30
>
> }
>
>  
>
> vrrp_script chk_haproxy {
>
>     script "killall -0 haproxy"
>
>     interval 1
>
>     weight 2
>
> }
>
>  
>
> vrrp_instance VI_1 {
>
>     interface eth0
>
>     state MASTER
>
>     virtual_router_id 51
>
>     priority 100
>
>  
>
>     smtp_alert
>
>  
>
>     authentication {
>
>        auth_type PASS
>
>        auth_pass 1234qwer
>
>     }
>
>  
>
>     virtual_ipaddress {
>
>         192.168.12.5
>
>         192.168.12.10
>
>     }
>
>  
>
>     track_script {
>
>        chk_haproxy
>
>     }
>
> }
>
>  
>
> Thank you in advance!
>
>  
>
>  
>
>  
>
>
>
> ------------------------------------------------------------------------------
> See everything from the browser to the database with AppDynamics
> Get end-to-end visibility with application monitoring from AppDynamics
> Isolate bottlenecks and diagnose root cause in seconds.
> Start your free trial of AppDynamics Pro today!
> http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
>
>
> _______________________________________________
> Keepalived-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/keepalived-devel

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk

_______________________________________________
Keepalived-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/keepalived-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.