<div dir="ltr">Use `backup` in conjunction with a status check[1] to a service you have written. This service should return &quot;nope, A is no good&quot; until you manually say otherwise somehow.<div><br></div><div>A status service can be as simple as portmap executed script like:</div><div><br></div><div>```</div><div><div>#!/bin/bash</div><div><br></div><div># This script is to be used by HAProxy&#39;s httpchk option, not the agent-check option</div><div><br></div><div># Do some stuff here to check for availability</div><div>myAvailabilityScript</div><div><br></div><div>if [ $? -eq 0 ]; then</div><div>  echo -e &quot;HTTP/1.1 200 OK\r\n&quot;</div><div>  echo -e &quot;Content-type: text/plain\r\n&quot;</div><div>  echo -e &quot;\r\n&quot;</div><div>  echo -e &quot;Good to go!\r\n&quot;</div><div>  echo -e &quot;\r\n&quot;</div><div>else</div><div>  echo -e &quot;HTTP/1.1 503 Service Unavailable\r\n&quot;</div><div>  echo -e &quot;Content-type: text/plain\r\n&quot;</div><div>  echo -e &quot;\r\n&quot;</div><div>  echo -e &quot;Much sadness\r\n&quot;</div><div>  echo -e &quot;\r\n&quot;</div><div>fi</div><div>```</div><div><br></div><div>[1] -- <a href="http://cbonte.github.io/haproxy-dconv/configuration-1.5.html#5.2-check">http://cbonte.github.io/haproxy-dconv/configuration-1.5.html#5.2-check</a></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jul 20, 2015 at 4:13 PM, James Sumners <span dir="ltr">&lt;<a href="mailto:james.sumners@gmail.com" target="_blank">james.sumners@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Er, ignore my last one. The setting you want is `backup` -- <a href="http://cbonte.github.io/haproxy-dconv/configuration-1.5.html#5.2-backup" target="_blank">http://cbonte.github.io/haproxy-dconv/configuration-1.5.html#5.2-backup</a></div><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Mon, Jul 20, 2015 at 3:32 PM, Robert L. Harris <span dir="ltr">&lt;<a href="mailto:robert.l.harris@gmail.com" target="_blank">robert.l.harris@gmail.com</a>&gt;</span> wrote:<br></span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr">Guys,<div>  I&#39;m setting up an HAProxy to balance between some web servers.  Working great with a least-used mode.</div><div><br></div><div>  The next step is to balance between 2 databases but I don&#39;t want them in a  round robin or even &#39;normal&#39; balancing.  The DBA&#39;s are setting up one-way data replication only ( long argument they are refusing to explain ).  So I need to have 2 hosts in a &#39;cluster&#39; with HostA as the single/primary and if it goes down, fail over to HostB.  If HostA comes back up, do NOT fail back to HostA until manually told to do so ( data re-sync, etc ).</div><div><br></div><div>Any thoughts?  I don&#39;t see an option to configure HAproxy in this type of config.</div><span><font color="#888888"><div><br></div><div>Robert</div><div><br></div></font></span></div>
<br></div></div><span class="">_______________________________________________<br>
Ale mailing list<br>
<a href="mailto:Ale@ale.org" target="_blank">Ale@ale.org</a><br>
<a href="http://mail.ale.org/mailman/listinfo/ale" rel="noreferrer" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
See JOBS, ANNOUNCE and SCHOOLS lists at<br>
<a href="http://mail.ale.org/mailman/listinfo" rel="noreferrer" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
<br></span></blockquote></div><span class=""><br><br clear="all"><div><br></div>-- <br><div><div dir="ltr"><div><div dir="ltr"><div>James Sumners<br><a href="http://james.sumners.info/" target="_blank">http://james.sumners.info/</a> (technical profile)</div><div><a href="http://jrfom.com/" target="_blank">http://jrfom.com/</a> (personal site)</div><div><a href="http://haplo.bandcamp.com/" target="_blank">http://haplo.bandcamp.com/</a> (band page)</div></div></div></div></div>
</span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>James Sumners<br><a href="http://james.sumners.info/" target="_blank">http://james.sumners.info/</a> (technical profile)</div><div><a href="http://jrfom.com/" target="_blank">http://jrfom.com/</a> (personal site)</div><div><a href="http://haplo.bandcamp.com/" target="_blank">http://haplo.bandcamp.com/</a> (band page)</div></div></div></div></div>
</div>