Cannot Start Varnish with Multiple Backends
Mark Gavin
mark at silverstatetech.com
Wed Nov 23 20:14:47 CET 2011
I am having so many problems getting started with Varnish to complete my two-part project. Part one is to configure Varnish as a load balancer, part two is to setup caching, but this mail is for part one only (getting Varnish running as a load balancer). Here is what I have
Dedicated Varnish Server
Dual Xeon processors, 32GB RAM, Red Hat EL6 64-bit, Varnish 2.1.5 installed from Yum using RHEL6 repository
Two Dedicated Web Servers
Dual Xeon processors, 16GB RAM, Red Hat EL5 64-bit, Apache 2.2.3 installed with Yum
Network
All servers behind hardware firewall, all servers communicate over internal subnet, all servers can ping each other, all servers have OS firewalls turned off, no restrictions between servers over the LAN.
I installed Varnish using the Red Hat EPEL repository with "yum install varnish", made a copy of the default VCL file, renamed the default file to forum.vcl and entered the following (note everything above and below this section is default and commented out from the original default file)
backend server9 {
.host = "192.168.1.118";
.port = "80";
.probe = {
.url = "/";
.interval = 5s;
.timeout = 1 s;
.window = 5;
.threshold = 3;
}
}
backend server10 {
.host = "192.168.1.5";
.port = "80";
.probe = {
.url = "/";
.interval = 5s;
.timeout = 1 s;
.window = 5;
.threshold = 3;
}
}
director baz round-robin {
{
.backend = server9;
}
{
.backend = server10;
}
}
sub vcl_recv {
if (req.http.host ~ "^(www.)?I put my domain name here$") {
set req.backend = baz;
}
}
I then executed the following commands
pkill varnish
varnishd -f /etc/varnish/forum.vcl -s malloc,10G -a 0.0.0.0:80
service varnish start
Alternate commands for above
pkill varnish
varnishd -a :80 -b 192.168.1.117:80 -b 192.168.1.5:80
service varnish start
and receive "Starting varnish HTTP accelerator: [FAILED]"
What I have tried
1. Commenting out each of the backends (one at a time)
2. Commenting out the if (req.http.host ~ "^(www.)?I put my domain name here$") {
3. Removing and reinstalling
4. Starting Varnish with the default backend (that works, so I assume Varnish is installed properly)
Basically it seems like when I define a backend that is another server, varnish will not start. I have read through many pages of documentation examples and I do not see where I am going wrong with this setup or I missed something. I am so frustrated at this point and would be so very grateful for any help you can offer.
Thank you,
Mark
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20111123/7db90c5e/attachment-0003.html>
More information about the varnish-misc
mailing list