Extending buildout.cfg to create a separate production.cfg for the production deployment

This is a short blog post how to use buildout configuration tool to create separate configurations for development and production runs for Plone CMS, If you want to know something about deploying ZEO cluster to the production servers then this blog post might make some sense for you.

In buildout configuration files, you can extend

  • Different buildout.cfg files
  • Different buildout sections

Here is a short example how to split your buildout to development and production configurations. We create two files:

  • buildout.cfg – singles process Zope instance for the development – base configuration
  • production.cfg – ZEO cluster installation for the production server, containing production specific bits

production.cfg extends buildout.cfg inherithing all the setup and simply declares more clients.

buildout.cfg can be any normal Plone Zope installation file e.g. one provided with Unified Installer.

The following production configuration is created by the example velow

  • ZEO database server (port 13000)
  • Four ZEO front end clients, clustered through a front end web server (13001..13004) with production grade cache sizes
  • One debug client, accesible over special SSH tunnel for debugging production bugs
  • One command line client, to be used for long-running tasks like migration runs

Note: There seems to be slight issue extending parts from other configuration files, so we cannot directly extend [instance]

Example production.cfg:

extends =

# We re-declare are parts here (though parts can come from buildout.cfg)
parts =

# On prod. server have a shared cached eggs folder

newest = false

recipe = plone.recipe.zeoserver
zeo-address =

# We need to re-declare instance as "head", as for some reason
# extending sections from the parent configuration file directly
# does not work
recipe = plone.recipe.zope2instance
debug-mode = off
verbose-security = off
zeo-client = true
zeo-address = ${zeoserver:zeo-address}
zeo-address =
zodb-cache-size = 200000
shared-blob = on
user = admin:admin
zeo-var = ${buildout:directory}/var
eggs = ${instance:eggs}
products = ${instance:products}
environment-vars = ${instance:environment-vars}

<= head
http-address = 13001

<= head
http-address = 13002

<= head
http-address = 13010
debug-mode = on
verbose-security = on

<= head
http-address = 13003

<= head
recipe = plone.recipe.zope2instance
http-address = 13004

<= head
recipe = plone.recipe.zope2instance
http-address = 99999
debug-mode = on
verbose-security = on

recipe = plone.recipe.unifiedinstaller
primary-port = 13001
sudo-command =
zeoserver = zeoserver
clients=client1 client2 client3 client4

Remember to run as bin/buildout -c production.cfg or symlink production.cfg as buildout.cfg on the production server. The latter is better as then you don’t forget the extra switch needed for bin/buildout command.

1. More info

\"\" Subscribe to RSS feed Follow me on Twitter Follow me on Facebook Follow me Google+

Leave a Reply

Your email address will not be published. Required fields are marked *