MappingStorage for ZEO Sessions?
hi I have a 4 client ZEO cluster that I am setting up a central sessions storage for. I'm wondering if someone can give me a little feedback on what I have done, eg i have a few questions: 1. am i doing this right? 2. where does the mapping storage store itself on the filesystem? as part of the Data.fs of the root-mounted filestorage? 3. If i add a transient object container a level below the zope root, will its data also get stored in the Mapping Storage? I am using MappingStorage and it is setup in zeo.conf like this: <mappingstorage sess> name mapping storage for sessions </mappingstorage> in zope.conf I have the temporary storage setup like this: <zodb_db temporary> <zeoclient> server 192.168.1.4:8424 storage sess name temporary mapping storage for sessioning </zeoclient> mount-point /temp_folder container-class Products.TemporaryFolder.TemporaryContainer </zodb_db> in zeo.log I get this: 2004-05-04T14:21:51 INFO(0) RUNSVR opening storage 'sess' using MappingStorage ------ 2004-05-04T14:21:51 INFO(0) ZSS:7175 StorageServer created RW with storages: 1:RW:/path/to/zeohome/var/Data.fs, sess:RW:mapping storage for sessions and later this: 2004-05-04T14:46:13 INFO(0) zrpc-conn:192.168.1.4:60202 zeoLoad() raised exception: '\x00\x00\x00\x00\x00\x00\x00\x00' Traceback (most recent call last): File "/usr/local/zope/270/lib/python/ZEO/zrpc/connection.py", line 264, in handle_request ret = meth(*args) File "/usr/local/zope/270/lib/python/ZEO/StorageServer.py", line 248, in zeoLoad p, s = self.storage.load(oid, '') File "/usr/local/zope/270/lib/python/ZODB/MappingStorage.py", line 56, in load p = self._index[oid] KeyError: '\x00\x00\x00\x00\x00\x00\x00\x00' the client connects fine, under Control Panel > Databases > temporary I see: Database Location temporary mapping storage for sessioning (connected) Database Size 239.0K also there are many writes and few loads. tia <--> george donnelly ~ http://www.zettai.net/ ~ "Quality Zope Hosting" Shared and Dedicated Zope Hosting ~ Zope Servers ~ Zope Websites Yahoo, AIM: zettainet ~ ICQ: 51907738 ~ Sales (USA): 1-866-967-3669
george donnelly wrote at 2004-5-4 17:09 -0500:
I have a 4 client ZEO cluster that I am setting up a central sessions storage for. I'm wondering if someone can give me a little feedback on what I have done, eg i have a few questions:
1. am i doing this right?
Does not look bad. Although we use the load balancer to always send the user to the same Zope instance. This way, a centralization of session info is not necessary.
2. where does the mapping storage store itself on the filesystem? as part of the Data.fs of the root-mounted filestorage?
I probably would try to keep the session info in RAM. They will get lost when ZEO is restarted -- but that happens (for us) only extremely rarely. I do not know whether ZEO supports such a RAM based storage already...
3. If i add a transient object container a level below the zope root, will its data also get stored in the Mapping Storage?
Learn about "mounting" (formerly known as "DBTab"). You can mount different storages at different points in your Zope hierarchy. I do not know, what you mean by "Mapping Storage". But, if this is a supported ZODB storage, you should be able to mount one whereever you want. You must be careful, however: you cannot use different connections to the *same* storage in the same transaction (this leads to deadlock). Use multiple mount points when you want to mount the same storage in different locations.
... I am using MappingStorage and it is setup in zeo.conf like this: ... and later this:
2004-05-04T14:46:13 INFO(0) zrpc-conn:192.168.1.4:60202 zeoLoad() raised exception: '\x00\x00\x00\x00\x00\x00\x00\x00' Traceback (most recent call last): File "/usr/local/zope/270/lib/python/ZEO/zrpc/connection.py", line 264, in handle_request ret = meth(*args) File "/usr/local/zope/270/lib/python/ZEO/StorageServer.py", line 248, in zeoLoad p, s = self.storage.load(oid, '') File "/usr/local/zope/270/lib/python/ZODB/MappingStorage.py", line 56, in load p = self._index[oid] KeyError: '\x00\x00\x00\x00\x00\x00\x00\x00'
This is normal. Your "mappingstorage" is still empty (it lacks the root). This causes the above error. When "ZODB.DB" gets this error, it creates the root object. -- Dieter
Dieter Maurer <dieter@handshake.de> on 5/5/04 wrote:
george donnelly wrote at 2004-5-4 17:09 -0500:
I have a 4 client ZEO cluster that I am setting up a central sessions storage for. I'm wondering if someone can give me a little feedback on what I have done, eg i have a few questions:
1. am i doing this right?
Does not look bad.
thanks :)
Although we use the load balancer to always send the user to the same Zope instance. This way, a centralization of session info is not necessary.
I feel like tying a user to a one instance partially defeats the purpose of a cluster i guess. if that instance goes down the user is inconvenienced.
2. where does the mapping storage store itself on the filesystem? as part of the Data.fs of the root-mounted filestorage?
I probably would try to keep the session info in RAM.
They will get lost when ZEO is restarted -- but that happens (for us) only extremely rarely.
yes the ZEO server is really stable IMO also.
I do not know, what you mean by "Mapping Storage". But, if this is a supported ZODB storage, you should be able to mount one whereever you want.
I have not found any good docs on it other than that it is non-undoable, non-versionable and based on FileStorage. thanks for your feedback. i really appreciate it. <--> george donnelly ~ http://www.zettai.net/ ~ "Quality Zope Hosting" Shared and Dedicated Zope Hosting ~ Zope Servers ~ Zope Websites Yahoo, AIM: zettainet ~ ICQ: 51907738 ~ Sales (USA): 1-866-967-3669
george donnelly wrote:
I feel like tying a user to a one instance partially defeats the purpose of a cluster i guess. if that instance goes down the user is inconvenienced.
George, We do a similar thing this our ZEO clusters. Instead of MappingStorage we use TemporaryStorage. The revelent bits from our configs: zeo.conf: %import DirectoryStorage # Main DirectoryStorage database <directorystorage main> path $INSTANCE/var/zodb read-only off </directorystorage> %import tempstorage <temporarystorage temp> name temporary storage for sessioning </temporarystorage> zope.conf: <zodb_db main> mount-point / <zeoclient> server 9999 storage main name zeostorage cache-size 1000000000 client client1 var $INSTANCE/var </zeoclient> </zodb_db> <zodb_db temporary> <zeoclient> server 9999 storage temp name zeostorage var $INSTANCE/var </zeoclient> mount-point /temp_folder container-class Products.TemporaryFolder.TemporaryContainer </zodb_db> *Note* This will not work out of the box in 2.7.0, as there is a method missing from TemporaryStorage.py. I think it is fixed in CVS, if not add the following method. def lastTransaction(self): """Return transaction id for last committed transaction""" return self._ltid -Matt -- Matt Hamilton matth@netsight.co.uk Netsight Internet Solutions, Ltd. Business Vision on the Internet http://www.netsight.co.uk +44 (0)117 9090901 Web Design | Zope/Plone Development & Consulting | Co-location | Hosting
On Tue, 2004-05-04 at 18:09, george donnelly wrote:
hi
I have a 4 client ZEO cluster that I am setting up a central sessions storage for. I'm wondering if someone can give me a little feedback on what I have done, eg i have a few questions:
1. am i doing this right?
2. where does the mapping storage store itself on the filesystem? as part of the Data.fs of the root-mounted filestorage?
A MappingStorage stores its data in RAM.
3. If i add a transient object container a level below the zope root, will its data also get stored in the Mapping Storage?
If you point the session data manager at a transient object container that resides in a mount point backed by a MappingStorage (or a ClientStorage that is backed by a MappingStorage on the ZEO side), its data will be stored there.
I am using MappingStorage and it is setup in zeo.conf like this:
<mappingstorage sess> name mapping storage for sessions </mappingstorage>
in zope.conf I have the temporary storage setup like this:
<zodb_db temporary> <zeoclient> server 192.168.1.4:8424 storage sess name temporary mapping storage for sessioning </zeoclient> mount-point /temp_folder container-class Products.TemporaryFolder.TemporaryContainer </zodb_db>
Looks right.
in zeo.log I get this:
2004-05-04T14:21:51 INFO(0) RUNSVR opening storage 'sess' using MappingStorage ------ 2004-05-04T14:21:51 INFO(0) ZSS:7175 StorageServer created RW with storages: 1:RW:/path/to/zeohome/var/Data.fs, sess:RW:mapping storage for sessions
and later this:
2004-05-04T14:46:13 INFO(0) zrpc-conn:192.168.1.4:60202 zeoLoad() raised exception: '\x00\x00\x00\x00\x00\x00\x00\x00' Traceback (most recent call last): File "/usr/local/zope/270/lib/python/ZEO/zrpc/connection.py", line 264, in handle_request ret = meth(*args) File "/usr/local/zope/270/lib/python/ZEO/StorageServer.py", line 248, in zeoLoad p, s = self.storage.load(oid, '') File "/usr/local/zope/270/lib/python/ZODB/MappingStorage.py", line 56, in load p = self._index[oid] KeyError: '\x00\x00\x00\x00\x00\x00\x00\x00'
I think this is a "normal" error when a database is first created.
the client connects fine, under Control Panel > Databases > temporary I see:
Database Location temporary mapping storage for sessioning (connected)
Database Size 239.0K
also there are many writes and few loads.
Seems like it's working... at least something is getting stored in it... not sure if that's sessions or not, but at least the infrastructure looks right. - C
participants (4)
-
Chris McDonough -
Dieter Maurer -
george donnelly -
Matt Hamilton