<div dir="ltr">Hi,<div><br></div><div>You will have to define a probe, otherwise Varnish will consider the backend to be healthy by default. You would then be able to manually make it sick, but for automatic health, you need probing.</div><div><br></div><div>Kind regards,<br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>-- <br></div>Guillaume Quintard<br></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Jul 4, 2020 at 8:47 AM hamidreza hosseini <<a href="mailto:hrhosseini@hotmail.com">hrhosseini@hotmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">




<div dir="ltr">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<span>Thanks for your answer,<br>
</span>
<div>I read yor blog post, you wrote there that fallback director will check the health status of the servers and it will choose one of them that is healthy(First one) , so by this explanation i dont need to define the prob for my backends to understand that
 my backends are healthy or not, is it true?<br>
</div>
<div>is this config file enough for my purpose?<br>
</div>
<div>"<br>
</div>
<div>import directors;<br>
</div>
<div><br>
</div>
<div>backend alpha1 { .host = "192.168.0.101"; }<br>
</div>
<div>backend alpha2 { .host = "192.168.0.201"; }<br>
</div>
<div>backend err    { .host = "192.168.0.150"; }<br>
</div>
<div><br>
</div>
<div>sub vcl_int {<br>
</div>
<div>    new alpha_rr = directors.round_robin();<br>
</div>
<div>    alpha_rr.add_backend(alpha1);<br>
</div>
<div>    alpha_rr.add_backend(alpha2);<br>
</div>
<div>    <br>
</div>
<div>    new alpha_fb = directors.fallback();<br>
</div>
<div>    alpha_fb.add_backend(alpha_rr.backend());<br>
</div>
<div>    alpha_fb.add_backend(err);<br>
</div>
<div>}<br>
</div>
<div>"<br>
</div>
<span>Best Regards</span><br>
</div>
<div id="gmail-m_-7974777659456583574appendonsend"></div>
<hr style="display:inline-block;width:98%">
<div id="gmail-m_-7974777659456583574divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Guillaume Quintard <<a href="mailto:guillaume@varnish-software.com" target="_blank">guillaume@varnish-software.com</a>><br>
<b>Sent:</b> Saturday, July 4, 2020 8:11 AM<br>
<b>To:</b> hamidreza hosseini <<a href="mailto:hrhosseini@hotmail.com" target="_blank">hrhosseini@hotmail.com</a>><br>
<b>Cc:</b> <a href="mailto:varnish-misc@varnish-cache.org" target="_blank">varnish-misc@varnish-cache.org</a> <<a href="mailto:varnish-misc@varnish-cache.org" target="_blank">varnish-misc@varnish-cache.org</a>><br>
<b>Subject:</b> Re: solution for Active/Passive Backend</font>
<div> </div>
</div>
<div>
<div dir="ltr">Hi,
<div><br>
</div>
<div>You want to use probes and the fallback director.</div>
<div><br>
</div>
<div>Relevant documentation:</div>
<div>to define a probe:<a href="https://varnish-cache.org/docs/6.4/reference/vcl.html?highlight=probe#probes" target="_blank">https://varnish-cache.org/docs/6.4/reference/vcl.html?highlight=probe#probes</a></div>
<div>to attach it to backends: <a href="https://varnish-cache.org/docs/6.4/reference/vcl.html?highlight=probe#backend-definition" target="_blank">https://varnish-cache.org/docs/6.4/reference/vcl.html?highlight=probe#backend-definition</a></div>
<div>the fallback director: <a href="https://varnish-cache.org/docs/6.4/reference/vmod_directors.html?highlight=fallback#directors-fallback" target="_blank">https://varnish-cache.org/docs/6.4/reference/vmod_directors.html?highlight=fallback#directors-fallback</a></div>
<div><br>
</div>
<div>i also wrote these blog posts a long time ago, but they are still valid:</div>
<div><a href="https://info.varnish-software.com/blog/backends-load-balancing" target="_blank">https://info.varnish-software.com/blog/backends-load-balancing</a><br>
</div>
<div><a href="https://info.varnish-software.com/blog/backends-load-balancing-part-2" target="_blank">https://info.varnish-software.com/blog/backends-load-balancing-part-2</a><br>
</div>
<div><br>
</div>
<div>The first one goes through probes, and the second one explores directors, including the fallback one.</div>
<div><br>
</div>
<div>Hope that helps</div>
<div><br>
</div>
<div>-- 
<div>
<div dir="ltr">
<div dir="ltr">Guillaume Quintard<br>
</div>
</div>
</div>
<br>
</div>
</div>
<br>
<div>
<div dir="ltr">On Sat, Jul 4, 2020 at 7:14 AM hamidreza hosseini <<a href="mailto:hrhosseini@hotmail.com" target="_blank">hrhosseini@hotmail.com</a>> wrote:<br>
</div>
<blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Hi,</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
I want to have 2 or 3 backends in the Varnish config file but just one of them workes as an active backend and whenever my active backend failed , the second backend become active and respond the requests. (In other hand, I dont want to have two backend for
 responding clients and just one of them works at the same time, and it check the health status of my active backend , whenever it is was unhealthy , varnish switch to the second or third backend.)<br>
Best Regards.<br>
</div>
</div>
_______________________________________________<br>
varnish-misc mailing list<br>
<a href="mailto:varnish-misc@varnish-cache.org" target="_blank">varnish-misc@varnish-cache.org</a><br>
<a href="https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc" rel="noreferrer" target="_blank">https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc</a><br>
</blockquote>
</div>
</div>
</div>

</blockquote></div>