[Zope] DirectoryStorage & ZEO... how?
Wankyu Choi
wankyu@neoqst.com
Wed, 30 Apr 2003 18:10:27 +0900
Here's how I do it.
1. custom_zodb.py on ZEO Client
import ZEO.ClientStorage
=20
ZSS_SERVER=3D'10.0.0.1' # assuming your ZSS is running=20
ZSS_PORT=3D8888 # on 10.0.0.1:8888
=20
Storage=3DZEO.ClientStorage.ClientStorage( ( ZSS_SERVER, ZSS_PORT ) =
)
2. start script on ZEO client
#! /bin/sh
=20
PATH=3D"/bin:/usr/bin:/usr/sbin:/sbin"
ZOPE_HOME=3D/usr/lib/zope
INSTANCE_HOME=3D/usr/lib/zope
INST_HOME=3D${INSTANCE_HOME}
# CLIENT_HOME=3D/opt/storage/zope
#STUPID_LOG_SEVERITY=3D"-300"
#export STUPID_LOG_SEVERITY=20
=20
export INST_HOME INSTANCE_HOME ZOPE_HOME PATH CLIENT_HOME
=20
sudo -u zope python $ZOPE_HOME/z2.py \ # zope is the =
user
under which Zope runs
-u zope \
-z $ZOPE_HOME \
-Z /var/run/zwatchdog.pid \
-w 8080 \
-f 8021 \
-m '' \
-l /var/log/zope \
-D \ =20
>> /var/log/zope 2>&1 \
&
4. start script on ZEO Storage Server
=20
#! /bin/sh
=20
PATH=3D"/bin:/usr/bin:/usr/sbin:/sbin"
ZOPE_HOME=3D/usr/lib/zope
INSTANCE_HOME=3D/usr/lib/zope
INST_HOME=3D${INSTANCE_HOME}
CLIENT_HOME=3D/opt/storage/zope
#STUPID_LOG_SEVERITY=3D"-300"
# export STUPID_LOG_SEVERITY=20
export INST_HOME INSTANCE_HOME ZOPE_HOME PATH CLIENT_HOME
=20
exec python /usr/lib/zope/ZEO/start.py -u zope -D -p 8888 -S
1=3D$ZOPE_HOME/zeo_custom_zodb:Storage \
>> /var/log/zope 2>&1 \
&
4. zeo_custom_zodb.py on ZSS
import os,sys
=20
from DirectoryStorage.Full import Full as S
from DirectoryStorage.Filesystem import Filesystem
=20
# Change this to point to your database directory
fs =3D Filesystem('/opt/storage/zope/dirstorage') # assuming your
dirstorage resides under /opt/storage/zope=20
=20
Storage =3D S(fs) =20
You should sudo to the user ZEO expects ( not root ): create a user for =
the
sole purpose of running ZEO. If you try to run ZEO as root or do not =
sudo to
the ZEO user, you'd end up with ZEO clients waiting forever for answers =
from
ZEO: that is, they'll just hang and you won't know what's happening =
since
ZEO logs nothing about this weirdness even with =
"STUPID_LOG_SEVERITY=3D-300".
I wasted more than a week to figure out what was going on.=20
Hope this helps.
Wankyu Choi
---------------------------------------------------------------
Wankyu Choi
CEO/President
NeoQuest Communications, Inc.
http://www.zoper.net
http://www.neoboard.net
--------------------------------------------------------------- =20
-----Original Message-----
From: zope-admin@zope.org [mailto:zope-admin@zope.org] On Behalf Of Paul
Winkler
Sent: Wednesday, April 30, 2003 11:00 AM
To: zope@zope.org
Cc: tdickenson@geminidataloggers.com
Subject: [Zope] DirectoryStorage & ZEO... how?
i feel like i'm missing something terribly obvious...
* with FileStorage, i used a custom_zodb.py to run zope as a zeo client.
* DS includes an example custom_zodb.py apparently for running zope =
without
zeo and with DS.
... but how do i get the zeo server to use DS?
i've searched the docs and the DS mailing list archive and found =
nothing.
but apparently people are doing it.=20
i guess that i'm to use the -S argument to ZEO/start.py but
i don't understand the docstring. what the heck is storage_name?
--=20
Paul Winkler
home: http://www.slinkp.com
"Muppet Labs, where the future is made - today!"
_______________________________________________
Zope maillist - Zope@zope.org =
http://mail.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -=20
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )