You are not logged in Log in Join
You are here: Home » Members » natsukashi » Products » ZEO ClientStorage » INSTALL.txt » View Document

Log in
Name

Password

 

INSTALL.txt

Installing MountedStorage (Zope)

To install MountedStorage, uncompress the MountedStorage product into your zope/Products directory or link it there, e.g.:

    ln -s /path/to/installation /path/to/zope/Products

Start or Restart Zope.

Additional Installation Notes (ZEO-specific):

  1. Please make sure that you have already installed and setup a working ZEO storage server. See the file docs/ZopeREADME.txt and docs/start.txt in the ZEO installation directory.

The ZEO ClientStorages product is useless without a working ZEO storage server.

These additional installation notes do not cover the setup or configuration of Zope to use a ZEO Client storage (using the custom_zodb.py file) as it's main database.

  1. Here is an example startup script for a zeo server. I call this script (zeod). You will need to adjust the paths to reflect your actual setup and environment. The names and directory structure simply reflect my own taste ... modify to suit your own needs.

        #!/bin/sh

# version PYTHON_MAJOR_VERSION=2.1 PYTHON_MINOR_VERSION=2.1.1 ZOPE_MAJOR_VERSION=2.4 ZOPE_MINOR_VERSION=2.4.1

# ZEO client ZEO_CLIENT=$ZOPE_SERVER:$ZOPE_PORT_HTTP export ZEO_CLIENT

# ZEO server ZEO_USER=zfs ZEO_SERVER=`hostname` ZEO_PORT=7111 ZEO_STORAGE=/u01/app/var/zeo-1.0/var export ZEO_USER ZEO_SERVER ZEO_PORT ZEO_STORAGE

# zope PATH=/opt/app/lib/bin:$PATH LD_LIBRARY_PATH=/opt/app/lib/lib:$LD_LIBRARY_PATH INSTANCE_HOME=/opt/app/app/zeo-1.0 ZOPE_HOME=/opt/app/lib/zope/zope-$ZOPE_MINOR_VERSION SOFTWARE_HOME=$ZOPE_HOME/lib/python export PATH LD_LIBRARY_PATH INSTANCE_HOME SOFTWARE_HOME cd $INSTANCE_HOME

# zope log ACCESS_LOG_FILE=/u01/app/var/zeo-1.0/log/ZEO.alog export ACCESS_LOG_FILE

# zope slog STUPID_LOG_FILE=/u01/app/var/zeo-1.0/log/ZEO.slog export STUPID_LOG_FILE

# zope plog #PROFILE_PUBLISHER=/u01/app/var/zeo-1.0/log/ZEO.plog #export PROFILE_PUBLISHER

# See how we were called. case "$1" in start) # Start daemon. echo -n "Starting zeo: " exec /opt/app/lib/bin/python$PYTHON_MAJOR_VERSION \ $SOFTWARE_HOME/ZEO/start.py \ -p $ZEO_PORT \ -u $ZEO_USER \ -S prd=$ZEO_STORAGE/Data:Storage \ -S I00_prd=$ZEO_STORAGE/vzfs/I00/prd/main/Data:Storage \ -S I00_prd_session=$ZEO_STORAGE/vzfs/I00/prd/session/Data:Storage \ -S I00_tst=$ZEO_STORAGE/vzfs/I00/tst/main/Data:Storage \ -S I00_tst_session=$ZEO_STORAGE/vzfs/I00/tst/session/Data:Storage \ -S I00_dev=$ZEO_STORAGE/vzfs/I00/dev/main/Data:Storage \ -S I00_dev_session=$ZEO_STORAGE/vzfs/I00/dev/session/Data:Storage \ "$@" echo ;; stop) # Stop daemon. echo -n "Shutting down zeo: " kill `cat ./var/ZEO_SERVER.pid` rm -f ./var/ZEO_SERVER.pid.bak mv -f ./var/ZEO_SERVER.pid ./var/ZEO_SERVER.pid.bak echo ;; restart) # Stop/Start daemon. ./bin/zeod stop sleep 1 ./bin/zeod start echo ;; *) echo "Usage: zeod {start|stop|restart}" exit 1 esac

exit 0

  1. The above script (zeod) assumes that you have already created a directory structure for the log files and ZODB data files for 7 ZODB storages (prd, I00_prd, I00_prd_session, I00_tst, I00_tst_session, I00_dev, I00_dev_session). If you have not installed the bsddb3 storage Product, you can simply remove all references to the *_session storages.

The directory structure for the ZODB storages should look something like this:

prd $ZEO_STORAGE/Data.py

I00_prd $ZEO_STORAGE/vzfs/I00/prd/main/Data.py I00_prd_session $ZEO_STORAGE/vzfs/I00/prd/session/Data.py

I00_tst $ZEO_STORAGE/vzfs/I00/tst/main/Data.py I00_tst_session $ZEO_STORAGE/vzfs/I00/tst/session/Data.py

I00_dev $ZEO_STORAGE/vzfs/I00/dev/main/Data.py I00_dev_session $ZEO_STORAGE/vzfs/I00/dev/session/Data.py

NOTE: By convention, "prd" is a primary storage used in Zope's custom_zodb.py file while the others are secondary storages that are used as mounted storages.

  1. You also need to manually create a Data.py file in each of the corresponding storage directories. Fortunately, ZEO will automatically create the Data.fs.* files for ZODB.FileStorage storages and the data/log files for Products.bsddb3Storage storages. Here are some sample Data.py files:

    prd

import os dir=os.path.join(INSTANCE_HOME,var) quota=10241024200 import ZODB.FileStorage

if not os.access(os.path.join(dir,data), os.F_OK): os.mkdir(os.path.join(dir,data))

Storage=ZODB.FileStorage.FileStorage(file_name=os.path.join(dir,data,Data.fs),quota=quota)

I00_prd

import os dir=os.path.join(INSTANCE_HOME,var,vtfs,I00,prd,main) quota=10241024200 import ZODB.FileStorage

if not os.access(os.path.join(dir,data), os.F_OK): os.mkdir(os.path.join(dir,data))

Storage=ZODB.FileStorage.FileStorage(file_name=os.path.join(dir,data,Data.fs),quota=quota)

I00_prd_session

import os dir=os.path.join(INSTANCE_HOME,var,vtfs,I00,prd,session) quota=10241024200

if not os.access(os.path.join(dir,data), os.F_OK): os.mkdir(os.path.join(dir,data))

if not os.access(os.path.join(dir,data,DB_CONFIG), os.F_OK): dbc = open(os.path.join(dir,data,DB_CONFIG), w) dbc.write(''' set_lg_dir %s ''' % (os.path.join(dir,log))) dbc.close()

if not os.access(os.path.join(dir,log), os.F_OK): os.mkdir(os.path.join(dir,log))

import Products.bsddb3Storage.Minimal Storage=Products.bsddb3Storage.Minimal.Minimal(name=I00_prd_session,env=os.path.join(dir,data))

and so on for I00_tst, I00_tst_session, etc.

  1. Once you have completed all of the necessary setup of ZEO, you should startup ZEO and it should produce a message in ZEO's log file similiar to the one below:

        2001-09-05T01:42:06 INFO(0) zdaemon zdaemon: Wed Sep  5 10:42:06 2001: Houston, we have forked
        ------
        2001-09-05T01:42:06 INFO(0) zdaemon zdaemon: Wed Sep  5 10:42:06 2001: Houston, we have forked
        ------
        2001-09-05T01:42:06 INFO(0) zdaemon zdaemon: Wed Sep  5 10:42:06 2001: Hi, I just forked off a kid: 26897
        ------
        2001-09-05T01:42:09 INFO(0) ZEO Server Serving I00_dev: 
        ------
        2001-09-05T01:42:09 INFO(0) ZEO Server Serving I00_dev_session: 
        ------
        2001-09-05T01:42:09 INFO(0) ZEO Server Serving I00_prd: 
        ------
        2001-09-05T01:42:09 INFO(0) ZEO Server Serving I00_prd_session: 
        ------
        2001-09-05T01:42:09 INFO(0) ZEO Server Serving I00_tst: 
        ------
        2001-09-05T01:42:09 INFO(0) ZEO Server Serving I00_tst_session: 
        ------
        2001-09-05T01:42:09 INFO(0) ZEO Server Serving prd:     
        ------
        2001-09-05T01:42:09 INFO(0) ZEO Server Listening on ('', 7111)

  1. Once ZEO is listening for client storage connections, it is time to add a mounted ZEO Client storage to your main zope database.

Using the ZMI, add a "MountedClientStorage" inside a folder of your choice. In the Mounted Client Storage Form, the Host field should correspond to your ZEO storage server and the port should correspond to the ZEO storage server port (7111 in the above example). The Storage field should be one of the following secondary storages: I00_prd, I00_prd_session, I00_tst, I00_tst_session, I00_dev, or I00_dev_session. You should also check the Auto-create folder path option as well.

Repeat step 6 for each of the secondary storages with an id and inside a folder of your own choice.