Every time I attempt to add an extra back end into our VCL file, it's fails.
Here is the DAEMON_OPTS we are running off:
DAEMON_OPTS="-a :80 \ -T localhost:6082 \ -f /etc/varnish/custom.vcl \ -u varnish -g varnish \ -S /etc/varnish/secret \ -s malloc,10G"
And here is the offending backend(s)
backend b1 { .host = "114.123.456.789"; .port = "8080"; }
backend b2 { .host = "203.123.456.789"; .port = "80"; }
Any Ideas ? Gut feeling is it might need the backends to be set somewhere, but I'm not sure where.
Solved
So, it turns out I needed to set the backends in the vcl script, further down in the vcl file (vcl_recv). If this helps anyone else, this is the code that I copied from (https://www.varnish-cache.org/trac/wiki/VCLExampleRestarts)
sub vcl_recv {
if (req.restarts == 0) {
set req.backend = b1;
} else if (req.restarts == 1) {
set req.backend = b2;
}
}
/dev/null
- temporarily tweak that to allow that output to be displayed, then try to start the service again?