Maintenance mode, or multiple backends but just one used

Bedis 9 bedis9 at gmail.com
Thu Dec 2 10:05:23 CET 2010


Hi,

First of all, your backend is labelled "oops" while in your error it
says "Unused backend oopsy". (there is a Y at the end...), maybe a
typo?

Second, you can use "restarts" and "backend.healthy" properties of a
request to detect a failure and switch to your "oops" backend.

cheers


On Wed, Dec 1, 2010 at 2:57 PM, Cosimo Streppone <cosimo at streppone.it> wrote:
> Hi,
>
> This is varnish 2.0.4. I have a VCL where I define a backend like:
>
>  backend nginx {
>    .host = "127.0.0.1";
>    .port = "8080";
>  }
>
> and then later in vcl_recv:
>
>  set req.backend = nginx;
>
> Then I modified the VCL to add another backend,
> to test it as downtime/maintenance service, so
> that all requests coming in will just display a
> "we're upgrading/we're offline" static page:
>
>  backend oops {
>     .host = "1.2.3.4";
>     .port = "80";
>  }
>
> At the same time I modified req.backend to be "oops".
> Now, I'm using only one backend.
> If the backend that gets to be used in req.backend is
> the last defined one, then everything's fine.
>
> If the used backend is any other than the last one,
> I get this VCC error:
>
>  Message from VCC-compiler:
>  Unused backend oopsy, defined:
>  (input Line 24 Pos 9)
>  backend oops {
>  --------#####--
>  Running VCC-compiler failed, exit 1
>  VCL compilation failed
>
> This came as a surprise... Is there a way around it?
>
> I'll probably setup a different "maintenance.vcl"
> and alternate the VCL configs between "main.vcl" and "maintenance.vcl"
> when I need to.
>
> Any better alternatives?
>
> --
> Cosimo
>
> _______________________________________________
> varnish-misc mailing list
> varnish-misc at varnish-cache.org
> http://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
>




More information about the varnish-misc mailing list