如何使清漆轮状zeo客户

问题描述

|| 我想使用plone.recipe.varnisin buildout将清漆配置为在2个zeo客户端之间进行轮询。在我的buildout.cfg中,我尝试过:
[varnish-build]
recipe = zc.recipe.cmmi
url = http://downloads.sourceforge.net/project/varnish/varnish/2.1.3/varnish-2.1.3.tar.gz

[varnish-instance]
recipe = plone.recipe.varnish
daemon = ${buildout:directory}/parts/varnish-build/sbin/varnishd
bind = 127.0.0.1:8000
balancer = round-robin
backends =
        client1:127.0.0.1:8080
        client2:127.0.0.1:8081
cache-size = 1G
[varnish-build]
recipe = zc.recipe.cmmi
url = http://downloads.sourceforge.net/project/varnish/varnish/2.1.3/varnish-2.1.3.tar.gz

[varnish-instance]
recipe = plone.recipe.varnish
daemon = ${buildout:directory}/parts/varnish-build/sbin/varnishd
bind = 127.0.0.1:8000
balancer = round-robin
backends =
        cluster:127.0.0.1:8080
        cluster:127.0.0.1:8081
cache-size = 1G
都不起作用,它们都给我“错误404未知虚拟主机”。我可以手动将varnish.vcl编辑为
director cluster round-robin {
  { .backend = { .host = \"127.0.0.1\"; .port = \"8080\"; } }
  { .backend = { .host = \"127.0.0.1\"; .port = \"8081\"; } }
}
一切都会按照我希望的方式进行,但我想在扩展中做到这一点。 我正在使用统一安装程序Plone 4.0.5,Ubuntu 10.0.4(64位),Varnish 2.1.3。有任何想法吗?谢谢!     

解决方法

有关负载平衡的信息,请参见http://pypi.python.org/pypi/plone.recipe.varnish。 您也可以使用自定义varnish.vcl文件,并使用\'config \'选项指定该文件。我倾向于使用collective.recipe.template来输出VCL文件,因为无论如何我通常都需要一些自定义配置。