<div dir="ltr"><div class="markdown-here-wrapper" id="markdown-here-wrapper-310053" style="font-size:1em;font-family:Helvetica,arial,freesans,clean,sans-serif;color:rgb(34,34,34);background-color:rgb(255,255,255);border:none;line-height:1.2">
<p style="margin:1em 0px">Additional:</p>
<pre style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;overflow:auto;margin:1em 0px"><code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:nowrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;display:inline;white-space:pre;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block;padding:0.5em;color:rgb(51,51,51);background-color:rgb(248,248,255);background-repeat:initial initial">
Distributor ID: Ubuntu
Description: Ubuntu 12.04.2 LTS
Release: 12.04
Codename: precise
ii haproxy 1.4.18-0ubuntu1.1 fast and reliable load balancing reverse proxy
ii keepalived 1:1.2.2-3ubuntu1 Failover and monitoring daemon for LVS clusters</code></pre>
</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, May 6, 2013 at 4:07 PM, Lei Zhang <span dir="ltr"><<a href="mailto:zhang.lei.fly@gmail.com" target="_blank">zhang.lei.fly@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div style="line-height:1.2;color:rgb(34,34,34);font-size:1em;font-family:Helvetica,arial,freesans,clean,sans-serif;border:none">
<p style="margin:1em 0px">Hi Guys,</p>
<p style="margin:1em 0px">I am trying to use keepalive and haproxy to work together to improve the HA of the openstack. But I meet following<br>unexpected issue. </p>
<p style="margin:1em 0px">I expect that when the haproxy process is crashed on the MASTER node(checked by chk_haproxy), the second node<br>will take over the VIP. But when I stop the haproxy process, nothing is happened.<br>
However, when stop the keepalived service, the VIP is set up on the node2 as expected. </p>
<p style="margin:1em 0px">So I think the root cause should be the chk_haproxy block. But I have no idea why it doesn't work. Does any body have<br>ideas?</p>
<p style="margin:1em 0px"><strong>node1 keepalived.conf</strong></p>
<pre style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;overflow:auto;margin:1em 0px"><code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:nowrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;display:inline;white-space:pre-wrap;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block;padding:0.5em;color:rgb(51,51,51);background-color:rgb(248,248,255);background-repeat:initial initial">global_defs {
lvs_id LVS_228
}
vrrp_sync_group openstack_haproxy {
group {
v1
v2
}
}
vrrp_script chk_haproxy {
script "killall -0 haproxy"
interval 2
debug
weight 2
}
vrrp_instance v1 {
interface eth0
debug
state MASTER
virtual_router_id 1
priority 101
virtual_ipaddress {
<a href="http://192.168.0.230/24" target="_blank">192.168.0.230/24</a>
}
track_script {
chk_haproxy
}
}
vrrp_instance v2 {
interface eth1
state MASTER
debug
virtual_router_id 2
priority 101
virtual_ipaddress {
<a href="http://10.1.0.30/16" target="_blank">10.1.0.30/16</a>
}
track_script {
chk_haproxy
}
}</code></pre>
<p style="margin:1em 0px"><strong>node2 keepalived.conf</strong></p>
<pre style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;overflow:auto;margin:1em 0px"><code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:nowrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;display:inline;white-space:pre-wrap;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block;padding:0.5em;color:rgb(51,51,51);background-color:rgb(248,248,255);background-repeat:initial initial">global_defs {
lvs_id LVS_229
}
vrrp_sync_group openstack_haproxy {
group {
v1
v2
}
}
vrrp_script chk_haproxy {
script "killall -0 haproxy"
interval 2
weight 2
}
vrrp_instance v1 {
interface eth0
state BACKUP
virtual_router_id 1
priority 100
virtual_ipaddress {
192.168.0.230
}
track_script {
chk_haproxy
}
}
vrrp_instance v2 {
interface eth1
state BACKUP
virtual_router_id 2
priority 100
virtual_ipaddress {
10.1.0.30
}
track_script {
chk_haproxy
}
}</code></pre><span class="HOEnZb"><font color="#888888">
</font></span></div><span class="HOEnZb"><font color="#888888"><div>-- <br><div><span style="font-family:arial,sans-serif;font-size:13px;border-collapse:collapse">Lei Zhang</span></div><div><span style="font-family:arial,sans-serif;font-size:13px;border-collapse:collapse"><br>
</span></div><div><font face="arial, sans-serif">Blog: <a href="http://jeffrey4l.github.com" target="_blank">http://jeffrey4l.github.com</a></font></div><div>twitter/weibo: @jeffrey4l</div>
</div></font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div><span style="font-family:arial,sans-serif;font-size:13px;border-collapse:collapse">Lei Zhang</span></div><div><span style="font-family:arial,sans-serif;font-size:13px;border-collapse:collapse"><br>
</span></div><div><font face="arial, sans-serif">Blog: <a href="http://jeffrey4l.github.com" target="_blank">http://jeffrey4l.github.com</a></font></div><div>twitter/weibo: @jeffrey4l</div>
</div>