Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install collective.recipe.zope2cluster

How to install collective.recipe.zope2cluster

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install collective.recipe.zope2cluster
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
1.1 Available View build log
Windows (64-bit)
1.1 Available View build log
Mac OS X (10.5+)
1.1 Available View build log
Linux (32-bit)
1.1 Available View build log
Linux (64-bit)
1.1 Available View build log
 
Author
License
ZPL
Lastest release
version 1.1 on Jan 5th, 2011

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]

System Message: ERROR/3 (<string>, line 15)

Inconsistent literal block quoting.

recipe = collective.recipe.zope2cluster instance-clone = instance http-address = 8081

Would become:

[instance2]

System Message: ERROR/3 (<string>, line 22)

Inconsistent literal block quoting.

<= instance http-address = 8081

Here is a complete example:

[buildout]

System Message: ERROR/3 (<string>, line 28)

Inconsistent literal block quoting.

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]

System Message: ERROR/3 (<string>, line 63)

Inconsistent literal block quoting.

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',

System Message: ERROR/3 (<string>, line 92)

Inconsistent literal block quoting.

... """ ... [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)

System Message: ERROR/3 (<string>, line 117)

Inconsistent literal block quoting.

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

System Message: ERROR/3 (<string>, line 126)

Inconsistent literal block quoting.

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

System Message: ERROR/3 (<string>, line 148)

Inconsistent literal block quoting.

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

System Message: WARNING/2 (<string>, line 177)

Bullet list ends without a blank line; unexpected unindent.

[claytron]

1.0 (2008-07-28)

  • Implemented instance cloning code

System Message: WARNING/2 (<string>, line 183)

Bullet list ends without a blank line; unexpected unindent.

[claytron]

  • Implemented tests

System Message: WARNING/2 (<string>, line 186)

Bullet list ends without a blank line; unexpected unindent.

[claytron]

  • Created recipe with ZopeSkel

System Message: WARNING/2 (<string>, line 189)

Bullet list ends without a blank line; unexpected unindent.

[claytron]

Download

Subscribe to package updates

Last updated Jan 5th, 2011

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.