from the README file:
My use case is like this:
But first let's try it and see if it works with a very simple setup: 2 ZEO servers and 1 client:
Download RaidStorage from http://codebrowse.launchpad.net/~gocept/gocept.zeoraid/trunk/changes and install it.
Here is my zope.conf file (you can guess the zeo.conf files)
I can't manage to get it to work with the setup described in the component.xml file. that's why I modified my zope.conf to look like as above.
After starting the ZEO1 and ZEO2 servers, we start the client with runzope so we can see what's going on(I stripped the datetime so you can see the end of lines):
It looks like it is working. it complains about the sortKey method. I added it to RAIDStorage class (I don't know if I did it the right way):
and try again:
It works, let's see our Data.fs files
That's good, we have the same length for both Data.fs.
Let's go forward and add a plone site to our instance:
I get an error and my zope instance crashes. That's bad:
I guessed it was a plone problem (wrong guess) and I tried again. No problem this time :-/
Look again to the Data.fs files:
Yes, it is working.
What happen if we stop a ZEO server ?
and here is the output from runzope:
OK, now edit the front page of the plone site and save. Here are the Data.fs files:
it is still working: the second Data.fs is updated.
Restart the ZEO1 server again:
and at this level nothing happen. I expected to see the raidStorage trying to connect to the ZEO1 server (read the post "A fallback ZEO") .
Edit and save the front page of the plone site. See the Data.fs files:
That means: When a ZEO server dies, RaidStorage never come back to see if it is alive again.
Conclusion:
The RaidStorage is in DEV stage and not ready for production yet. It is promising and really needed.
The ZEO RAID storage is a proxy storage that works like a RAID controller by creating a redundant array of ZEO servers. The redundancy is similar to RAID level 1 except that each ZEO server keeps a complete copy of the database.
Therefore, up to N-1 out of N ZEO servers can fail without interrupting.
It is intended that any storage can be used as a backend storage for a RAID storage, although typically a ClientStorage will be the direct backend.
[ ZEO 1 ] ... [ ZEO N ]
\ /
\ /
\ /
\ /
\ /
\ /
[ ZEO RAID ]
/ \
/ \
/ \
/ \
/ \
/ \
[ Zope 1 ] ... [ Zope M]
My use case is like this:
[ ZEO 1 ] ... [ ZEO N ]
\ \ / \
\ \ / \
\ \ / \
\ \ / \
\ /\ \
\ / \ \
[ ZEO RAID ] [ ZEO RAID ]
| |
| |
| |
| |
| |
| |
[ Zope 1] .... [Zope M]
But first let's try it and see if it works with a very simple setup: 2 ZEO servers and 1 client:
Download RaidStorage from http://codebrowse.launchpad.net/~gocept/gocept.zeoraid/trunk/changes and install it.
Here is my zope.conf file (you can guess the zeo.conf files)
%import gocept.zeoraid
<zodb_db main>
mount-point /
<raidstorage>
<zeoclient 1>
server localhost:8881
storage 1
</zeoclient>
<zeoclient 2>
server localhost:8882
storage 1
</zeoclient>
</raidstorage>
</zodb_db>
I can't manage to get it to work with the setup described in the component.xml file. that's why I modified my zope.conf to look like as above.
After starting the ZEO1 and ZEO2 servers, we start the client with runzope so we can see what's going on(I stripped the datetime so you can see the end of lines):
$ rep_client/bin/runzope
2007-04-08 12:41:32 INFO ZServer HTTP server started at Fri Apr 8 12:41:32 2007
Hostname: 0.0.0.0
Port: 8080
2007-04-08 12:41:37 WARNING Init Class Products.ATContentTypes.content.base.ATCTFolderMixin has a security declaration for nonexistent method 'manage_copyObjects'
2007-04-08 12:41:39 INFO PlacelessTranslationService Applying patch
*** Patching ZPublisher.Publish with the get_request patch! ***
INFO ZEO.ClientStorage (299) ClientStorage (pid=299) created RW/normal for storage: '1'
INFO ZEO.cache created temporary cache file ''
INFO ZEO.ClientStorage (299) Testing connection
INFO ZEO.zrpc.Connection(C) (localhost:8881) received handshake 'Z303'
INFO ZEO.ClientStorage (299) Server authentication protocol None
INFO ZEO.ClientStorage (299) Connected to storage: ('localhost', 8881)
INFO ZEO.ClientStorage (299) Verifying cache
INFO ZEO.ClientStorage (299) Waiting for cache verification to finish
INFO ZEO.ClientStorage (299) Waiting for cache verification to finish
INFO ZEO.ClientStorage (299) endVerify finishing
INFO ZEO.ClientStorage (299) endVerify finished
INFO ZEO.ClientStorage (299) ClientStorage (pid=299) created RW/normal for storage: '1'
INFO ZEO.cache created temporary cache file ''
INFO ZEO.ClientStorage (299) Testing connection
INFO ZEO.zrpc.Connection(C) (localhost:8882) received handshake 'Z303'
INFO ZEO.ClientStorage (299) Server authentication protocol None
INFO ZEO.ClientStorage (299) Connected to storage: ('localhost', 8882)
INFO ZEO.ClientStorage (299) Verifying cache
INFO ZEO.ClientStorage (299) Waiting for cache verification to finish
INFO ZEO.ClientStorage (299) Waiting for cache verification to finish
INFO ZEO.ClientStorage (299) endVerify finishing
INFO ZEO.ClientStorage (299) endVerify finished
ERROR Zope Zope Default Object Creation: Could not add a /temp_folder mount point due to an error.
......
AttributeError: 'RAIDStorage' object has no attribute 'sortKey'
It looks like it is working. it complains about the sortKey method. I added it to RAIDStorage class (I don't know if I did it the right way):
def sortKey(self):
return self._apply_single_storage('sortKey')
and try again:
$ rep_client/bin/runzope
...
2007-04-08 12:52:44 INFO Zope Ready to handle requests
It works, let's see our Data.fs files
$ ls -l rep_zeo1/var/Data.fs rep_zeo2/var/Data.fs
-rw-r--r-- 1 mustapha mustapha 2313720 8 Apr 12:52 rep_zeo1/var/Data.fs
-rw-r--r-- 1 mustapha mustapha 2313720 8 Apr 12:52 rep_zeo2/var/Data.fs
That's good, we have the same length for both Data.fs.
Let's go forward and add a plone site to our instance:
http://localhost:8080/manage_addProduct/CMFPlone/addPloneSiteForm
I get an error and my zope instance crashes. That's bad:
2007-04-08 13:08:17 INFO ZEO.ClientStorage (306) Disconnected from storage: "('localhost', 8881)"
...
...asyncore.py", line 122, in poll
r, w, e = select.select(r, w, e, timeout)
select.error: (9, 'Bad file descriptor')
I guessed it was a plone problem (wrong guess) and I tried again. No problem this time :-/
Look again to the Data.fs files:
$ ls -l rep_zeo1/var/Data.fs rep_zeo2/var/Data.fs
-rw-r--r-- 1 mustapha mustapha 3936029 8 Apr 13:10 rep_zeo1/var/Data.fs
-rw-r--r-- 1 mustapha mustapha 3936029 8 Apr 13:10 rep_zeo2/var/Data.fs
Yes, it is working.
What happen if we stop a ZEO server ?
$ rep_zeo1/bin/zeoctl stop
. daemon process stopped
and here is the output from runzope:
INFO ZEO.ClientStorage (333) Disconnected from storage: "('localhost', 8881)"
WARNING ZEO.zrpc (333) CW: error connecting to ('localhost', 8881): EINVAL
WARNING ZEO.zrpc (333) CW: error connecting to ('localhost', 8881): EINVAL
WARNING ZEO.zrpc (333) CW: error connecting to ('localhost', 8881): EINVAL
WARNING ZEO.zrpc (333) CW: error connecting to ('localhost', 8881): EINVAL
WARNING ZEO.zrpc (333) CW: error connecting to ('localhost', 8881): EINVAL
WARNING ZEO.zrpc (333) CW: error connecting to ('localhost', 8881): EINVAL
WARNING ZEO.zrpc (333) CM.close(): self.thread.join() timed out
OK, now edit the front page of the plone site and save. Here are the Data.fs files:
$ ls -l rep_zeo1/var/Data.fs rep_zeo2/var/Data.fs
-rw-r--r- 1 mustapha mustapha 3936029 8 Apr 13:10 rep_zeo1/var/Data.fs
-rw-r--r-- 1 mustapha mustapha 3949285 8 Apr 13:30 rep_zeo2/var/Data.fs
it is still working: the second Data.fs is updated.
Restart the ZEO1 server again:
$ rep_zeo1/bin/zeoctl start
. daemon process started, pid=377
and at this level nothing happen. I expected to see the raidStorage trying to connect to the ZEO1 server (read the post "A fallback ZEO") .
Edit and save the front page of the plone site. See the Data.fs files:
$ ls -l rep_zeo1/var/Data.fs rep_zeo2/var/Data.fs
-rw-r--r-- 1 mustapha mustapha 3936029 8 Apr 13:10 rep_zeo1/var/Data.fs
-rw-r--r-- 1 mustapha mustapha 3960858 8 Apr 13:40 rep_zeo2/var/Data.fs
That means: When a ZEO server dies, RaidStorage never come back to see if it is alive again.
Conclusion:
The RaidStorage is in DEV stage and not ready for production yet. It is promising and really needed.