[Zope] Multiple databases and ZEO
Bill Anderson
bill@noreboots.com
Sun, 10 Dec 2000 18:14:26 -0700
Shane Hathaway wrote:
>
> Bill Anderson wrote:
> >
> > Shane Hathaway wrote:
> > >
> > > On Tue, 5 Dec 2000, Bill Anderson wrote:
> > > > So, what would you suggest for the following scenario?
> > > >
> > > > o Site distirbuted via ZEO
> > > > o Using SiteAccess2 for virtual hosting sites under
> > > > /vhosts/thissite /vhosts/thatsite
> > > > o each site is actually it's own full Data.fs
> > > >
> > > > Under non-zeo, it's simple, use a mounted filestorage, and it works
> > > > quite well. Unfortunately, it doesn't work under zeo, for obvious
> > > > reasons. If I had time, I'd do a mountedZEOstorage, but time is too much
> > > > a precious commodity for the next few weeks/months. :/
> > >
> > > What do you mean it doesn't work under ZEO? Set it up just like zope.org.
> >
> > Simple: I have a site running on it's own right now. It is based right
> > of of the root of the data.fs, not under a folder (like a wiki is). If I
> > try the externalmount you tarred up for us (thank you, btw), it insist
> > on having a path inside said data.fs. If I give it a folder in said
> > data.fs it works for that folder, as expected.
>
> MountedFileStorage lets you mount the root of the database through a
> very "iffy" scheme that I don't think could be made reliable. I'm sure
> there's a right way to do it, but I think for now your best option is to
> create a folder in the database you intend to mount, then move all
> content into that folder. That's how Wikis.fs is mounted.
OK, I suppose I can live with that for now ... though i do have a
question abou tit.
Packing a database.
in one of the cases I am considering, I am wanting to seperate the
sub-site into a seperate DB because this subsite will likely contain
many objects, and many changes to those objects. At the moment, they are
being developed using ZPatters, so if needs be I can change the storage
in the future (mmmm Zpatterns gooood). If I pack from the main site,
does the 'mounted' folder also get packed, or will i need to do that
seperately somehow?
If seperate, how does one do that?
> > > Either create two storage servers or one that provides access to both
> > > FileStorages. Then write an external method for each storage, each of
> > > which creates a ClientStorage and wraps a DB around it.
> >
> > How do I do this part? I made one for FileStorage (the example given),
> > which works fine. Substituting ClientStorage for FileStorage didn;t
> > work. ;)
>
> Here's our external method:
>
> ------- 8-< ---------
>
> # Define the Wiki database mounted database
> import ZServer, ZODB, ZEO.ClientStorage
>
> def wikidb():
> Storage=ZEO.ClientStorage.ClientStorage(
> ('10.0.11.1',2222),
> cache_size=50*1000*1000,
> max_disconnect_poll=40,
> min_disconnect_poll=1,
> storage='Wikis',
> )
> return ZODB.DB(Storage)
>
> ------- 8-< ---------
Thanks, I'll get to this in the next day or so. I am currently setting
everything up to use sockets, so I imagine it shouldn't be to hard to
convert, just change the options passed, no? :)
> > ...mebbe I've just been too deep in scsi code lately to think properly
> > ... ugh.
>
> Been hacking kernels lately? There's no hacking like kernel hacking.
> Bare metal. Oh yeah. :-)
Yup, in fact I think we fixed a somewhat serious FC bug ... I hope.