<div dir="ltr"><div class="markdown-here-wrapper" id="markdown-here-wrapper-402162" 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">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;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">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">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;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>
</div><div class="markdown-here-signature">-- <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></div>