开发者

How to make varnish round-robin zeo clients

开发者 https://www.devze.com 2023-03-02 04:55 出处:网络
I would like to use plone.recipe.varnisin buildout to configure varnish to round-robin between 2 zeo clients.In my buildout.cfg I have tried:

I would like to use plone.recipe.varnisin buildout to configure varnish to round-robin between 2 zeo clients. In my buildout.cfg I have tried:

[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-robi开发者_如何学JAVAn
backends =
        client1:127.0.0.1:8080
        client2:127.0.0.1:8081
cache-size = 1G

and

[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

Neither work, they both give me "Error 404 Unknown virtual host". I can manually edit the varnish.vcl to

director cluster round-robin {
  { .backend = { .host = "127.0.0.1"; .port = "8080"; } }
  { .backend = { .host = "127.0.0.1"; .port = "8081"; } }
}

and everything works they way I wwant, except I would like to do this in buildout.

I am using the unified installer Plone 4.0.5, Ubuntu 10.0.4 (64 bit), Varnish 2.1.3. Any ideas? Thanks!


See http://pypi.python.org/pypi/plone.recipe.varnish for information about load balancing.

You can also use a custom varnish.vcl file and specify that with the 'config' option. I tend to use collective.recipe.template to output a VCL file, since I usually need some custom configuration anyway.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号