Fwd: Varnish round robin using Director - FIXED

Tharanga Abeyseela tharanga.abeyseela at gmail.com
Thu Aug 29 13:25:42 CEST 2013


Sorry my mistake, i need to define the backend before use it.

now i can start the daemon, but it is not doing the round-robin
loadbalancing. i want the first request go to the backend website and the
second should go to the api.

director clust round-robin {
{ .backend = website;
}
{ .backend = api;
}

sub vcl_recv {
if ( req.url ~ "/api/") {
set req.backend = api;
set req.http.host = "hari.com";
} else {
set req.backend = clust;
}
}
it always going to the backend -website

---------- Forwarded message ----------
From: Tharanga Abeyseela <tharanga.abeyseela at gmail.com>
Date: Thu, Aug 29, 2013 at 8:57 PM
Subject: Varnish round robin using Director
To: varnish-misc at varnish-cache.org


Hi Guys,

I'm trying to load-balance requests between two servers. i have the
following config.

backend website {
    .host = "xxx.com";
    .port = "8080";
   .probe = {
    .url = "/favicon.ico";
    .timeout = 60ms;
    .interval = 60s;
    .window = 5;
    .threshold = 3;
}
}
backend api {
    .host = "yyy.com";
    .port = "8080";
   .probe = {
    .url = "/favicon.ico";
    .timeout = 60ms;
    .interval = 60s;
    .window = 5;
    .threshold = 3;
}
}

sub vcl_recv {
if ( req.url ~ "/api/") {
set req.backend = api;
set req.http.host = "yyyy.com";
} else {
set req.backend = website;
}
}

director clust round-robin {
{ .backend = website; }
{ .backend = api; }
}

but this is giving the following error.

Unused backend clust, defined:
('input' Line 39 Pos 10)
director clust round-robin {
---------#####--------------

then i was tyring to add set req.backend = clust (then it is giving the
error,

Symbol not found: 'clust' (expected type BACKEND):

am i missing something here.

Cheers,
Tharanga
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20130829/5ca11b73/attachment.html>


More information about the varnish-misc mailing list