问题
I'm working on setting up a Zope Replicated Storage (ZRS) based deployment. I currently have two servers (east and west)
west will be the primary
east will be the secondary
I haven't touched the west box yet. On the east box I've edited my buildout as follows (I had to pin plone.recipe.zeoserver to 1.2.6 because the zrs features didn't exist before version 1.2.6):
[zeoserver]
recipe = plone.recipe.zeoserver[zrs]
replicate-from = ${hosts:zeoserver-west}:${ports:zeoserver-zrs}
[versions]
plone.recipe.zeoserver = 1.2.6
After running
bin/buildout
I try to start my cluster and the instances seem to hang. A debugging instance now gives me the following output:
2013-09-11 08:24:00 INFO ZServer HTTP server started at Wed Sep 11 08:24:00 2013
Hostname: localhost
Port: 7680
2013-09-11 08:24:02 INFO Products.PloneFormGen gpg_subprocess initialized, using /usr/bin/gpg
2013-09-11 08:24:02 INFO DeadlockDebugger Not activated, you must change ACTIVATED in custom.py
2013-09-11 08:24:02 INFO ZEO.ClientStorage zeostorage ClientStorage (pid=22802) created RW/normal for storage: '1'
2013-09-11 08:24:02 INFO ZEO.cache created temporary cache file '<fdopen>'
2013-09-11 08:24:02 INFO ZEO.ClientStorage zeostorage Testing connection <ManagedClientConnection ('127.0.0.1', 7600)>
2013-09-11 08:24:02 INFO ZEO.zrpc.Connection(C) (127.0.0.1:7600) received handshake 'Z3101'
2013-09-11 08:24:02 INFO ZEO.ClientStorage zeostorage Server authentication protocol None
2013-09-11 08:24:02 INFO ZEO.zrpc.Connection(C) (127.0.0.1:7600) received handshake 'Z3101'
2013-09-11 08:24:02 INFO ZEO.ClientStorage zeostorage Testing connection <ManagedClientConnection ('127.0.0.1', 7600)>
2013-09-11 08:24:02 INFO ZEO.ClientStorage zeostorage Server authentication protocol None
2013-09-11 08:24:02 INFO ZEO.zrpc.Connection(C) (127.0.0.1:7600) received handshake 'Z3101'
2013-09-11 08:24:02 INFO ZEO.ClientStorage zeostorage Testing connection <ManagedClientConnection ('127.0.0.1', 7600)>
2013-09-11 08:24:02 INFO ZEO.ClientStorage zeostorage Server authentication protocol None
2013-09-11 08:24:07 INFO ZEO.ClientStorage zeostorage Testing connection <ManagedClientConnection ('127.0.0.1', 7600)>
2013-09-11 08:24:07 INFO ZEO.zrpc.Connection(C) (127.0.0.1:7600) received handshake 'Z3101'
2013-09-11 08:24:07 INFO ZEO.ClientStorage zeostorage Server authentication protocol None
2013-09-11 08:24:07 INFO ZEO.zrpc.Connection(C) (127.0.0.1:7600) received handshake 'Z3101'
2013-09-11 08:24:07 INFO ZEO.ClientStorage zeostorage Testing connection <ManagedClientConnection ('127.0.0.1', 7600)>
2013-09-11 08:24:07 INFO ZEO.ClientStorage zeostorage Server authentication protocol None
2013-09-11 08:24:07 INFO ZEO.zrpc.Connection(C) (127.0.0.1:7600) received handshake 'Z3101'
2013-09-11 08:24:07 INFO ZEO.ClientStorage zeostorage Testing connection <ManagedClientConnection ('127.0.0.1', 7600)>
2013-09-11 08:24:07 INFO ZEO.ClientStorage zeostorage Server authentication protocol None
I've copied the Data.fs over so it's available on east. I'm wondering if this has anything to do with the primary ZRS not being up yet. This is my first initial test and I just wanted to see the secondary working before setting up the primary.
If I removing the zrs settings and rebuild buildout the cluster starts without issue.
回答1:
Make sure that you also set the "east" clients read-only. That option was added to plone.recipe.zope2instance in version 4.2.12.
It's the "read-only" option in the definition of a basic ZEO storage.
回答2:
Anything in the zeoserver log?
I assume that's not your full zeoserver configuration correct? The ZRS replication runs on an additional port to the zeoserver so you still need to specify zeoserver host and port.
Additionally, run the replicated server in read-only mode and start from an empty database--you don't need to sync the database to start off, zrs will sync all up once it's running.
来源:https://stackoverflow.com/questions/18742513/plone-switching-to-zrs-using-plone-recipe-zeoserver-on-plone-4-3-1