Re: Keepalived track_script and failover
"Paul Robert Marino" <[email protected]>
| Newsgroups | gmane.linux.keepalived.devel |
|---|---|
| Message-ID | <[email protected]> |
Add 2 to each of your priorities so they don't go into negative numbers on the secondary on a failure, and make the weight a -51 that will cause an offset of 50. In vrrp a differential of 50 supersedes a nopreempt -- Sent from my HP Pre3 ---------- On Jul 15, 2013 7:36 PM, Sheldon Lee-Wen <[email protected]> wrote: I made the requested changes and it works now. Fantastic. Thank you everyone! Now, if I want to add nopreempt to prevent fail backs can I do that safely by just adding that keyword to each config file and setting a weight of -50 to the chk_haproxy script? From: Sheldon Lee-Wen [ mailto:[email protected] ] Sent: July-15-13 6:29 PM To: [email protected] Subject: Re: [Keepalived-devel] Keepalived track_script and failover Ok, so let me make sure that I understand, my configs should look like the following, correct? 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 BACKUP virtual_router_id 51 priority 50 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 BACKUP virtual_router_id 51 priority 49 smtp_alert authentication { auth_type PASS auth_pass 1234qwer } virtual_ipaddress { 192.168.12.5 192.168.12.10 } track_script { chk_haproxy } } From: Paul Robert Marino [ mailto:[email protected] ] Sent: July-15-13 6:03 PM To: Thomas Heil; [email protected] Subject: Re: [Keepalived-devel] Keepalived track_script and failover I agree with Thomas since you don't have nopreempt enabled but I also think you should have both as state BACKUP that way you can set a preempt_delay to prevent flapping. The priority difference will handle the rest. You only have to worry about making the priority off set by 50 if you are using nopreempt and even then it should be on the check script doing a weight -50 on failure of the not on the initial priority. -- Sent from my HP Pre3 ---------- On Jul 15, 2013 5:14 PM, Thomas Heil <[email protected] > wrote: 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 ------------------------------------------------------------------------------ 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