Re: Keepalived track_script and failover

"Paul Robert Marino" <[email protected]>
Newsgroups gmane.linux.keepalived.devel
Message-ID <[email protected]>
Yes that looks correct

-- Sent from my HP Pre3

----------
On Jul 15, 2013 6:30 PM, Sheldon Lee-Wen <[email protected]> wrote:

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

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.