AMK's Home Zodb

Installing ZEO

This package contains the Python code for ZEO, packaged to make it easier to set up and run a ZEO Storage Server on your machine. Most notably, I've rewritten the start.py script to use a configuration file and renamed it to zeod.

WARNING: This packaging is HIGHLY EXPERIMENTAL and has only been tested on one machine, which happened to be running Red Hat 6.2. I fully expect there to be problems and incompatibilities on other Unix variants or even other Linux distributions. Please inform me of any problems, or post your questions to the ZEO mailing list at <zope-zeo@zope.org>.

Requirements

To run a ZEO server, you'll need Python 1.5.2 or 2.0, and the ZODB packages from http://www.amk.ca/files/zodb/ have to be installed.

Note for Python 1.5.2 users: ZEO requires updated versions of the asyncore.py and asynchat.py modules that are included in 1.5.2's standard library. You can grab copies of the Python 2.0 versions of these modules from http://www.amk.ca/files/zodb/, or from the Python 2.0 distribution.

Installation

The setup.py script won't do all the work for you at the moment, since two scripts need to go into odd locations and the Distutils don't seem to support this at the moment. One script goes into /etc/rc.d/init.d, so you can configure your system to start a ZEO Storage Server at boot-up.

  1. Run python setup.py install to install the ZEO/ package into your Python installation.
  2. Copy various files into their proper locations:
    cp zeo.conf /usr/local/etc/ ; chmod 644 /usr/local/etc/zeo.conf
    cp zeo /etc/rc.d/init.d ; chmod 755 /etc/rc.d/init.d/zeo
    cp zeod /usr/local/bin ; chmod 755 /usr/local/bin/zeod
    
  3. Edit /usr/local/etc/zeo.conf appropriately for your desired setup.

To test whether ZEO is working correctly, try running the following lines of code, which will connect to the server, add some bits of data to the root of the ZODB, and commits the transaction:

from ZEO import ClientStorage
from ZODB import DB

# Change next line to connect to your ZEO server
storage = ClientStorage.ClientStorage( ('kronos', 1972) )
db = DB( storage )
conn = db.open()
root = conn.root()

# Store some things in the root
root['list'] = ['a', 'b', 1.0, 3]
root['dict'] = {'a':1, 'b':4}

# Commit the transaction
get_transaction().commit()

If this code runs properly, then your ZEO server is probably working correctly.