[Zope-Coders] ZEO install/runtime issues fixed
Chris McDonough
chrism@zope.com
08 Apr 2003 10:13:17 -0400
On Mon, 2003-04-07 at 21:29, Richard Jones wrote:
> On Monday, April 7, 2003, at 11:43 PM, Chris McDonough wrote:
> > The various schema components (component.xml) in
> > ZODB, ZServer, and zLOG, as well as the master schema in Zope.Startup
> > (zopeschema.xml) are the best sources of documentation for the config
> > file at the moment.
>
> Could I suggest that ZConfig spawn a feature that spits out the config
> schema as plain-text or HTML? I believe there's enough information in
> there to be able to generate a "template" config file from the schema,
> akin to what's in the skel/etc/zope.conf.in (minus the <<bits>> of
> course). The HTML would be really nice - auto-documenting the schemas
> would be a big plus.
Yes, this should definitely happen... I'm going to put it in a TODO on
the trunk.
> On a related note, the zconfig command-line script is currently broken
> in the "installed" Zope tree due to path issues. I'd like to move it to
> the same scheme as the other scripts, where the bin/zconfig script is a
> thin generated wrapper that imports and runs the script functionality
> from the ZConfig lib. Or we could mutate the zconfig script as it's
> installed. Either way, something needs to be done.
Do you mean the 'zconfig' script in ZConfig/scripts? I'm not sure that
it has any place in an instance home, but I wouldn't mind if it (or a
sed-rendered edition of it) made its way into "bin" in the software
home... ZConfig is distributed separately from Zope, so the actual
script in the ZConfig package should have no Zope or absolute path
knowledge.
It would be cool to extend zopectl to have a 'zopectl check' feature
which just checks that a config file is well-formed (which is the job of
that zconfig script AFAIK).
> In then end though, I can't seem to get a zeoclient section working
> using the zope.conf file. The following seems to be ignored:
>
> <zodb>
> <zeoclient>
> server localhost:8082
> </zeoclient>
> </zodb>
>
> That is, my ZEO server doesn't receive a connection, and the client
> ends up with a local FileStorage being created. What I've got above
> _seems_ to be what I should put in there - after reading the various
> schema xml files, the ZConfig doc PDF and the ZConfig source code to
> figure what the socket-address value should be ... I still have no idea
> where the <zodb> section name comes from in the schema though, and
> would've been totally lost there if it wasn't for hints from other
> places like Chris' email :)
I just discovered yesterday that the ZODB configuration section is not
consulted by the startup process (within Zope/App/startup)! I'm going
to try to wire it up today. Sorry about that, it used to actually work.
:-(
But if it were to work, what you have is absolutely the right
incantation. ;-)
'socket-address' is a ZConfig built-in datatype defined within
ZConfig/datatypes.py. It allows you to name either a file or a
host/port combination (e.g. '/some/socket' or 'localhost:8881').
The <zodb> section comes from the ZODB components.xml file. Within
zopeschema.xml, its sectiontype is imported via:
<import package="ZODB"/>
The actual section is defined within the Zope schema via this:
<multisection type="ZODB.database" name="*" attribute="databases"/>
This means, roughly, "allow many sections of the type 'ZODB.database',
each one of which may have a name, and store the results in a list
attribute of the main configuration object named "databases"".
The ZODB.database type is defined within ZODB's component.xml like so:
<sectiontype name="zodb" datatype=".ZODBDatabase"
implements="ZODB.database">
<section type="ZODB.storage" name="*" attribute="storage"/>
<key name="cache-size" datatype="integer" default="5000"/>
<key name="pool-size" datatype="integer" default="7"/>
<key name="version-pool-size" datatype="integer" default="3"/>
<key name="version-cache-size" datatype="integer" default="100"/>
</sectiontype>
(That's where the name "zodb" for the section comes from").
> > I'm not sure about command-line options...
>
> Surely they're defined somewhere... I can't even unravel _that_ much :)
Hee hee... well, as you can tell, neither can I. ;-) I've tracked it
down enough to know that it has something to do with the
Zope.Startup.options module (as imported from a software home's
runzope.py). Looks like it also uses the schema to determine the
available options. If I find out more, I'll try to write it down
somewhere.
- C