This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!
Project Description

collective.recipe.zope2cluster

NOTE: This recipe is no longer needed as of zc.buildout 1.4.

Using zc.buildout to do the same thing

As of zc.buildout 1.4 you can create macros out of sections. This means that you do not need this recipe anymore.

The following:

[instance2]
recipe = collective.recipe.zope2cluster
instance-clone = instance
http-address = 8081

Would become:

[instance2]
<= instance
http-address = 8081

Here is a complete example:

[buildout]
parts =
   instance
   instance2

extends = http://dist.plone.org/release/3.3/versions.cfg
versions = versions

[versions]
zc.buildout = 1.4.1

[zope2]
recipe = plone.recipe.zope2install
url = ${versions:zope2-url}

[instance]
recipe = plone.recipe.zope2instance
user = admin:admin
zope2-location = ${zope2:location}
http-address = 8080

[instance2]
<= instance
http-address = 8081

Using this recipe

This recipe aims to make it easier to set up a cluster of zope clients. The zope2cluster recipe allows us to point to an existing plone.recipe.zope2instance part and copy it’s options. Any options we define in the zope2cluster part override the original instance’s options.

Example:

[instance]
recipe = plone.recipe.zope2instance
user = admin:admin
http-address = 8080

[instance2]
recipe = collective.recipe.zope2cluster
instance-clone = instance
http-address = 8081

Our instance2 part ends up being an exact copy of instance but changes the http-address to 8081.

Detailed Documentation

Supported options

The recipe supports the following options:

instance-clone
The name of the part that you want to ‘clone’. Typically instance.

Example usage

We’ll start by creating a buildout that uses the recipe:

>>> write('buildout.cfg',
... """
... [buildout]
... parts = instance instance2
... index = http://pypi.python.org/simple
...
... [instance]
... recipe = plone.recipe.zope2instance
... zope2-location = %(zope2_location)s
... user = admin:admin
... ip-address = 192.168.0.1
... http-address = 8080
... effective-user = zope
... event-log-level = CRITICAL
...
... [instance2]
... recipe = collective.recipe.zope2cluster
... instance-clone = instance
... ip-address = 192.168.0.2
... http-address = 8081
... event-log-level = WARN
... """ % globals())

Running the buildout gives us:

>>> print 'start', system(buildout)
start...
Installing instance2.
...

First let’s check to see that the original instance has the correct options:

>>> instance = os.path.join(sample_buildout, 'parts', 'instance')
>>> zc = open(os.path.join(instance, 'etc', 'zope.conf')).read()
>>> print zc
instancehome /sample-buildout/parts/instance
...
effective-user zope
ip-address 192.168.0.1
...
<eventlog>
  level CRITICAL
...
</eventlog>
...
<http-server>
...
  address 8080
...
</http-server>
...

Now let’s check our instance2 part to see if it is setup correctly:

>>> instance = os.path.join(sample_buildout, 'parts', 'instance2')
>>> zc = open(os.path.join(instance, 'etc', 'zope.conf')).read()
>>> print zc
instancehome /sample-buildout/parts/instance2
...
effective-user zope
ip-address 192.168.0.2
...
<eventlog>
  level WARN
...
</eventlog>
...
<http-server>
...
  address 8081
...
</http-server>
...

Contributors

Clayton Parker [claytron], Author

Change history

1.1 (2009-09-04)

  • No new code. Documentation update about zc.buildout 1.4.1 [claytron]

1.0 (2008-07-28)

  • Implemented instance cloning code [claytron]
  • Implemented tests [claytron]
  • Created recipe with ZopeSkel [claytron]

Download

Release History

Release History

1.1

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
collective.recipe.zope2cluster-1.1.tar.gz (6.0 kB) Copy SHA256 Checksum SHA256 Source Sep 4, 2009

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting