我想使用plone.recipe.varnisin buildout将varnish配置为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"; } }
}
并且一切都按照我的方式运作,除了我想在buildout中这样做。
我使用的是统一安装程序Plone 4.0.5,Ubuntu 10.0.4(64位),Varnish 2.1.3。有任何想法吗?谢谢!
答案 0 :(得分:4)
有关负载平衡的信息,请参阅http://pypi.python.org/pypi/plone.recipe.varnish。
您还可以使用自定义varnish.vcl文件,并使用'config'选项指定该文件。我倾向于使用collective.recipe.template来输出VCL文件,因为我通常需要一些自定义配置。