Personal tools
You are here: Home Documentation Tutorials Managing projects with zc.buildout A deployment configuration
Support

Get Help

Join our chat rooms or support forums if you have more specific questions.

Plone Training
Learn how to design, build, and deploy a website in Plone through one of the numerous Plone training sessions around the world.
Find Plone training…
 
Document Actions

A deployment configuration

How to use buildout for deployment configuration

Martin Aspeli

Learn about eggs, setuptools and dependency management, and how to use zc.buildout to set up a development environment.
Page 9 of 9.

Finally, let's take a look at a more advanced configuration, better suited for deployment. Save this file as deployment.cfg, at the root of the buildout next to the main buildout.cfg file:

[buildout]
extends =
    buildout.cfg

parts =
    plone
    zope2
    productdistros
    deploymentproducts
    zeoserver
    primary
    secondary
    varnish-build
    varnish-instance

[deploymentproducts]
recipe = plone.recipe.distros
urls =
    http://plone.org/products/cachefu/releases/1.1/CacheFu-1.1.tgz
nested-packages =
    CacheFu-1.1.tgz
version-suffix-packages = 

[zeoserver]
recipe = plone.recipe.zope2zeoserver
zope2-location = ${zope2:location}
zeo-address = 8100

[primary]
recipe = plone.recipe.zope2instance
zope2-location = ${zope2:location}
zeo-client = true
zeo-address = 8100
zodb-cache-size = 5000
zeo-client-cache-size = 300MB
user = admin:admin
http-address = 8080
debug-mode = off
verbose-security = off
eggs =
    ${plone:eggs}
    ${buildout:eggs}
zcml = 
    
products =
    ${buildout:directory}/products
    ${productdistros:location}
    ${deploymentproducts:location}
    ${plone:products}

[secondary]
recipe = plone.recipe.zope2instance
zope2-location = ${zope2:location}
zeo-client = true
zeo-address = 8100
zodb-cache-size = 5000
zeo-client-cache-size = 300MB
user = ${primary:user}
http-address = 8081
debug-mode = on
verbose-security = on
eggs = ${primary:eggs}
zcml = ${primary:zcml}
products = ${primary:products}
zope-conf-additional =
    zserver-threads 1
    
[varnish-build]
recipe = plone.recipe.varnish:build
url = http://puzzle.dl.sourceforge.net/sourceforge/varnish/varnish-1.0.4.tar.gz

[varnish-instance]
recipe = plone.recipe.varnish:instance
bind = 127.0.0.1:8082
backends = 127.0.0.1:8080
cache-size = 1G

Here, we are:

By combining buildout configuration files like this, you can create tailor-made configurations for different deployment scenarios. To learn more about the advanced features of buildout, see its documentation.

To build this environment, you must explicitly specify a configuration file:

$ ./bin/buildout -c deployment.cfg

To start Zope and Plone, you will need to start the ZEO server, the two clients (or at least, the primary one), and the Varnish server:

$ ./bin/zeoserver start
$ ./bin/primary start
$ ./bin/secondary start
$ ./bin/varnish-instance

The recipes will also create scripts to back up the ZODB (in ./bin/repozo) and to pack the database (in ./bin/zeopack).

Further options

zc.buildout is a very flexible system. It is relatively easy to create new recipes, and you can combine existing recipes in powerful ways. Search the Cheese Shop for "buildout" to find more recipes, or take a look at the source code for some of Plone's own recipes to understand how recipes are created.

 

 
by Martin Aspeli last modified September 14, 2007 - 12:22 All content is copyright Plone Foundation and the individual contributors.

Debug Mode is enabled

Posted by Volker Wend at October 21, 2007 - 17:45
The second zeo-client has debug mode enabled. This should not be used in production.

On purpose :)

Posted by Martin Aspeli at October 21, 2007 - 17:55
It depends. The configuration I'm showing here is actually one where there's only one "real" client. The secondary client is only brought up for debug purposes, e.g. if the primary client fails. In this case, having debug mode on can be useful. If they were both used for load balancing, then they should of course both have debug mode disabled.

No Varnish for Windows

Posted by Ian F. Hood at February 29, 2008 - 23:24
AFAIK the Varnish parts should not be used on win32.
Presumably commenting out the part names (#) from [buildout] should do the trick.

For any issues with the web site functionality, please file a ticket.

Please consult the policy on plone.org content if you want your content published on this site.

Servers and hosting by