<div dir="ltr"><div class="gmail_extra">On Thu, Oct 3, 2013 at 4:01 PM, James A. Robinson <span dir="ltr"><<a href="mailto:jim.robinson@stanford.edu" target="_blank">jim.robinson@stanford.edu</a>></span> wrote:<br><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="gmail_extra">I forgot that I'd need to set</div>
<div class="gmail_extra"><br></div><div class="gmail_extra"> set req.backend = <span style="font-family:arial,sans-serif;font-size:13px">member</span><br></div>
<div class="gmail_extra"><br></div><div class="gmail_extra">within each of those, but testing out the rest of the</div><div class="gmail_extra">configuration as I outlined seems to work as I</div><div class="gmail_extra">
expected.</div><div class="gmail_extra"><br></div><div class="gmail_extra">If I simulate a failure by using .probe that will</div><div class="gmail_extra">never succeed, I see traffic for one group get</div><div class="gmail_extra">
routed from its original server to a new one,</div><div class="gmail_extra">and when the .probe is reset to recover I see</div><div class="gmail_extra">the traffic move back.</div></blockquote></div><br></div><div class="gmail_extra">
<div class="gmail_extra">Last note: Setting up multiple director pools and weighting a</div><div class="gmail_extra">"primary" node higher than the others appears to allow for fine</div><div class="gmail_extra">
grained control over which host serves the content. If the primary</div><div class="gmail_extra">dies then the remaining nodes in the pool take over.</div><div class="gmail_extra"><br></div><div class="gmail_extra">So for a given set of backends:</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">backend b1 {</div><div class="gmail_extra"><span class="" style="white-space:pre"> </span>.host = "<a href="http://b1.example.org">b1.example.org</a>";</div>
<div class="gmail_extra"><span class="" style="white-space:pre"> </span>.port = "80";</div><div class="gmail_extra"><span class="" style="white-space:pre"> </span>.probe = { </div><div class="gmail_extra"><span class="" style="white-space:pre"> </span>.url = "/";</div>
<div class="gmail_extra"><span class="" style="white-space:pre"> </span>.timeout = 34 ms; </div><div class="gmail_extra"><span class="" style="white-space:pre"> </span>.interval = 1s; </div><div class="gmail_extra"><span class="" style="white-space:pre"> </span>.window = 10;</div>
<div class="gmail_extra"><span class="" style="white-space:pre"> </span>.threshold = 8;</div><div class="gmail_extra"> }</div><div class="gmail_extra">}</div><div class="gmail_extra"><br></div><div class="gmail_extra">
backend b2 {</div><div class="gmail_extra"><span class="" style="white-space:pre"> </span>.host = "<a href="http://b2.example.org">b2.example.org</a>";</div><div class="gmail_extra"><span class="" style="white-space:pre"> </span>.port = "80";</div>
<div class="gmail_extra"><span class="" style="white-space:pre"> </span>.probe = { </div><div class="gmail_extra"><span class="" style="white-space:pre"> </span>.url = "/";</div><div class="gmail_extra"><span class="" style="white-space:pre"> </span>.timeout = 34 ms; </div>
<div class="gmail_extra"><span class="" style="white-space:pre"> </span>.interval = 1s; </div><div class="gmail_extra"><span class="" style="white-space:pre"> </span>.window = 10;</div><div class="gmail_extra"><span class="" style="white-space:pre"> </span>.threshold = 8;</div>
<div class="gmail_extra"> }</div><div class="gmail_extra">}</div><div class="gmail_extra"><br></div><div class="gmail_extra">backend b3 {</div><div class="gmail_extra"><span class="" style="white-space:pre"> </span>.host = "<a href="http://b3.example.org">b3.example.org</a>";</div>
<div class="gmail_extra"><span class="" style="white-space:pre"> </span>.port = "80";</div><div class="gmail_extra"><span class="" style="white-space:pre"> </span>.probe = { </div><div class="gmail_extra"><span class="" style="white-space:pre"> </span>.url = "/";</div>
<div class="gmail_extra"><span class="" style="white-space:pre"> </span>.timeout = 34 ms; </div><div class="gmail_extra"><span class="" style="white-space:pre"> </span>.interval = 1s; </div><div class="gmail_extra"><span class="" style="white-space:pre"> </span>.window = 10;</div>
<div class="gmail_extra"><span class="" style="white-space:pre"> </span>.threshold = 8;</div><div class="gmail_extra"> }</div><div class="gmail_extra">}</div><div class="gmail_extra"><br></div><div class="gmail_extra">
define n pools, weighting a "primary" backend</div><div class="gmail_extra">and having the remaining evently weighted if</div><div class="gmail_extra">the primary dies:</div><div class="gmail_extra"><br></div><div class="gmail_extra">
director b1_pool client {</div><div class="gmail_extra"><span class="" style="white-space:pre"> </span>{</div><div class="gmail_extra"><span class="" style="white-space:pre"> </span>.backend = b1;</div><div class="gmail_extra">
<span class="" style="white-space:pre"> </span>.weight = 10;</div><div class="gmail_extra"><span class="" style="white-space:pre"> </span>}</div><div class="gmail_extra"><span class="" style="white-space:pre"> </span>{</div>
<div class="gmail_extra"><span class="" style="white-space:pre"> </span>.backend = b2;</div><div class="gmail_extra"><span class="" style="white-space:pre"> </span>.weight = 1;</div><div class="gmail_extra"><span class="" style="white-space:pre"> </span>}</div>
<div class="gmail_extra"><span class="" style="white-space:pre"> </span>{</div><div class="gmail_extra"><span class="" style="white-space:pre"> </span>.backend = b3;</div><div class="gmail_extra"><span class="" style="white-space:pre"> </span>.weight = 1;</div>
<div class="gmail_extra"><span class="" style="white-space:pre"> </span>}</div><div class="gmail_extra">}</div><div class="gmail_extra"><br></div><div class="gmail_extra">director b2_pool client {</div><div class="gmail_extra">
<span class="" style="white-space:pre"> </span>{</div><div class="gmail_extra"><span class="" style="white-space:pre"> </span>.backend = b1;</div><div class="gmail_extra"><span class="" style="white-space:pre"> </span>.weight = 1;</div>
<div class="gmail_extra"><span class="" style="white-space:pre"> </span>}</div><div class="gmail_extra"><span class="" style="white-space:pre"> </span>{</div><div class="gmail_extra"><span class="" style="white-space:pre"> </span>.backend = b2;</div>
<div class="gmail_extra"><span class="" style="white-space:pre"> </span>.weight = 10;</div><div class="gmail_extra"><span class="" style="white-space:pre"> </span>}</div><div class="gmail_extra"><span class="" style="white-space:pre"> </span>{</div>
<div class="gmail_extra"><span class="" style="white-space:pre"> </span>.backend = b3;</div><div class="gmail_extra"><span class="" style="white-space:pre"> </span>.weight = 1;</div><div class="gmail_extra"><span class="" style="white-space:pre"> </span>}</div>
<div class="gmail_extra">}</div><div class="gmail_extra"><br></div><div class="gmail_extra">director b3_pool client {</div><div class="gmail_extra"><span class="" style="white-space:pre"> </span>{</div><div class="gmail_extra">
<span class="" style="white-space:pre"> </span>.backend = b1;</div><div class="gmail_extra"><span class="" style="white-space:pre"> </span>.weight = 1;</div><div class="gmail_extra"><span class="" style="white-space:pre"> </span>}</div>
<div class="gmail_extra"><span class="" style="white-space:pre"> </span>{</div><div class="gmail_extra"><span class="" style="white-space:pre"> </span>.backend = b2;</div><div class="gmail_extra"><span class="" style="white-space:pre"> </span>.weight = 1;</div>
<div class="gmail_extra"><span class="" style="white-space:pre"> </span>}</div><div class="gmail_extra"><span class="" style="white-space:pre"> </span>{</div><div class="gmail_extra"><span class="" style="white-space:pre"> </span>.backend = b3;</div>
<div class="gmail_extra"><span class="" style="white-space:pre"> </span>.weight = 10;</div><div class="gmail_extra"><span class="" style="white-space:pre"> </span>}</div><div class="gmail_extra">}</div><div class="gmail_extra">
<br></div><div class="gmail_extra">and in sub vcl_recv { ... } we set</div><div class="gmail_extra"><br></div><div class="gmail_extra">if (req.url ~ "^/(a|b|c|d)[\.\/]") {</div><div class="gmail_extra"><span class="" style="white-space:pre"> </span>set req.backend = b1_pool</div>
<div class="gmail_extra"><span class="" style="white-space:pre"> </span>set client.identity = "b1"</div><div class="gmail_extra">}</div><div class="gmail_extra">else if (req.url ~ "^/(e|f|g|h)[\.\/]") {</div>
<div class="gmail_extra"><span class="" style="white-space:pre"> </span>set req.backend = b2_pool</div><div class="gmail_extra"><span class="" style="white-space:pre"> </span>set client.identity = "b2"</div><div class="gmail_extra">
}</div><div class="gmail_extra">else </div><div class="gmail_extra"><span class="" style="white-space:pre"> </span>set req.backend = b3_pool</div><div class="gmail_extra"><span class="" style="white-space:pre"> </span>set client.identity = "b3"</div>
<div class="gmail_extra">}</div><div><br></div></div></div>