[triangle-zpug] enable CMFPlone while creating a new zope instance?

Chris Calloway cbc at unc.edu
Thu Feb 9 17:40:50 CET 2006


Mike Revoir wrote:
> The scripts currently don't create a Plone inside a Zope.

Hunh. I thought that was the purpose. Oh, well.

I just got a ZEO cluster with processor affinity working last night. 
Bendy, I highly recommend you do this, if you want to create Plone 
instances on the fly. The reason being is so that you can get the Zope 
root object and start calling portal_factory on it (the "app" Geoff 
alluded to yesterday, which is the root of the Zope object hierarchy). 
Roughly, in a Python shell or script, something like:

import Zope
Zope.configure('/path/to/zope.conf')
app = Zope.app()
factory = app.manage_addProduct['CMFPlone']
factory.manage_addSite('bendysite')

Chris McDonough's ZODB presentation from Plone Symposium '05 that I gave 
again at TriZPUG may be of some use, if you don't want to do ZEO:

http://www.plope.com/static/presentations/zodb.pdf
http://media.plone.org/video/conference/2005/NOLASymposium/Chris%20McDonough%20-%20ZODB%20Tips%20and%20Tricks.wmv

You can do this without ZEO. It just requires that you stop Zope (i.e., 
all your sites stop responding), and write a script which loads, starts, 
and manages the ZODB transactions (as in the presentations above), 
including importing Zope and products (see PloneTestCase for clues). 
This is hard. And inconvenient. And not a way to manage a bunch of sites 
that people are using already. This is stuff which Zope and 
portal_factory all handle for you if you use ZEO and scripts. So use ZEO.

Second, Bendy, are you thinking of having one Zope instance contain all 
your Plone instances? If so, I highly recommend you check out the 
concept of Mount Points. A mount point is where your ZODB is split into 
separate storages (in the usual case, files, or Data.fs'es) which mount 
in place of folders in the Zope object hierarchy. You could have a 
separate ZODB storage file for each Plone site. This might help a lot in 
managing Plone sites, especially with making backups. I know I just feel 
better when all my Plone sites are all in one giant ZODB file storage. 
The way I've dealt with that in the past is a separate Zope instance for 
each Plone site, because all my Plone sites have different product 
mixes, Plone versions, Zope versions, Python version, yada yada. But if 
you are going to have one product mix for all your sites, you can have 
one Zope instance, and still have separation of data storage:

http://www.zettai.net/Support/FAQ/separateDbs

You should, and I know you are, spend some time thinking about the 
management of these sites if there are going to be a lot of them, as I 
think you are saying there will be.

-- 
Sincerely,

Chris Calloway
http://www.seacoos.org
office: 17-6 Venable Hall   phone: (919) 962-4323
mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599





More information about the triangle-zpug mailing list