检查清漆4中2个以上Web服务器的后端运行状况

时间:2017-05-07 10:19:49

标签: linux caching load-balancing varnish httpbackend

有一个带有3个后端的清漆服务器。所有后端都是apache。一切都很好,清漆服务器缓存我需要的一切,连接正常。我想监视Web服务器的健康状况。如果失败,清漆不会向失败的Web服务器发送reuest。问题是当我为所有后台启用探测时,我得到503错误!如果我在一个或两个后端上启用它,一切正常,但当我为3个后端启用它时,我得到503错误。这里是后端和健康检查的清漆配置:

vcl 4.0;

import directors;

probe backend_healthcheck {
   .url = "/";
   .timeout = 34 ms;
   .window = 5;
   .threshold = 3;
   .interval = 1s;

}

backend web1 {
    .host = "192.168.1.16";
    .port = "8080";
    .probe = backend_healthcheck;
}

backend web2 {
    .host = "192.168.1.18";
    .port = "8080";
    .probe = backend_healthcheck;
}

backend web3 {
    .host = "192.168.1.20";
    .port = "8080";
    .probe = backend_healthcheck;
}

 sub vcl_init {
    new apache = directors.round_robin();
    apache.add_backend(web1);
    apache.add_backend(web2);
    apache.add_backend(web3);
}

0 个答案:

没有答案