varnish digitalocean配置指南出错:未找到符号:' req.backend.healthy' (预期类型BOOL):

时间:2015-06-20 22:28:50

标签: ubuntu varnish digital-ocean varnish-vcl

我关注此https://www.digitalocean.com/community/tutorials/how-to-configure-varnish-for-drupal-with-apache-on-debian-and-ubuntu并在运行/etc/init.d/varnish restart之后发出此错误:

 * Stopping HTTP accelerator varnishd                                    [fail]
 * Starting HTTP accelerator varnishd                                    [fail]
Message from VCC-compiler:
Symbol not found: 'req.backend.healthy' (expected type BOOL):
('input' Line 44 Pos 9)
    if (req.backend.healthy)
--------###################-

Running VCC-compiler failed, exited with 2

VCL compilation failed

第44行

if (req.backend.healthy)
{
    set req.grace = 60s;
}
else
{
    set req.grace = 30m;
}

我看到这篇帖子https://www.varnish-cache.org/lists/pipermail/varnish-misc/2014-May/023692.html似乎认为它与版本有关。我在Ubuntu 14.04上运行4.0.3修订版b8c4a34。

1 个答案:

答案 0 :(得分:1)

清漆4. *与Varnish 3有点不同。*

req.backend.healthy不再存在,因为您可以看到here。新方法是:

  

std.healthy(req.backend_hint)