Re: Keepalived track_script and failover

"Ryan O'Hara" <[email protected]>
Newsgroups gmane.linux.keepalived.devel
Message-ID <[email protected]>
On Mon, Jul 15, 2013 at 04:50:20PM +0000, 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?

Can you please make sure that iptables is not blocking VRRP packets? I
recently assisted someone else with this exact same problems and it
turned out to be iptables.

Also, you have both nodes set as MASTER. I'm not entirely sure what
will happen when you do this, but it could very well be causing
problems. Either set Host2 to BACKUP state or set both to BACKUP.

Ryan


> 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
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.