ZRS in Python 3 and 5.2

Hi,
Did someone has ZRS working on Python3/Plone 5.2?
No luck here making it work...
Cheers,
V.

Didn't try yet, but what exactly is the error? Not installable? No sync?

No sync... :frowning: no error in logs either...

if anyone has at hand a full config example will be appreciated.

Here is a working Python2 example:

Primary:

[zeoserver]
recipe = plone.recipe.zeoserver[zrs]
eggs =
    plone.recipe.zeoserver[zrs]
    ${buildout:eggs}
zeo-address = <ip-address-primary>:8100

# zc.zrs configuration
replicate-to = <ip-address-primary>:8102

Secondary

[zeoserver]
recipe = plone.recipe.zeoserver[zrs]
eggs =
    plone.recipe.zeoserver[zrs]
    ${buildout:eggs}
zeo-address = 127.0.0.1:8100

# zc.zrs configuration
replicate-from = <ip-address-primary>:8102

You should see something like this in your logs:

Primary:

(29717) Blob dir /mnt/data/blobstorage/ has insecure mode setting
Opening /mnt/data/filestorage/Data.fs ('<ip-address-primary>', 8102)
PrimaryFactory starting on 8102
Starting factory <zc.zrs.primary.PrimaryFactory instance at 0x7f7b17855998>
StorageServer created RW with storages: 1:RW:/mnt/data/filestorage/Data.fs
(29717) listening on ('<ip-address-primary>', 8100)
listening on ('127.0.0.1', 8101)
...
IPv4Address(TCP, '<ip-address-secondary>', 53458): Connected
IPv4Address(TCP, '<ip-address-secondary>', 53458): start '\x00\x00\x00\x00\x00\x00\x00\x00' (1900-01-01 00:00:00.000000)

Secondary:

(16792) created PID file '/projectfolder/zeoserver/var/zeoserver/zeoserver.pid'
(16792) opening storage '1' using ZRS
Ignoring index for /mnt/data/filestorage/Data.fs
(16792) Blob dir /mnt/data/blobstorage/ has insecure mode setting
Opening /mnt/data/filestorage/Data.fs ('<ip-address-primary>', 8102)
Starting factory <zc.zrs.secondary.SecondaryFactory instance at 0x7fb1c582d830>
StorageServer created RW with storages: 1:RO:/mnt/data/filestorage/Data.fs
(16792) listening on ('127.0.0.1', 8100)
listening on ('127.0.0.1', 8101)
IPv4Address(TCP, '<ip-address-primary>', 8102): Connected
1 Like

@tmassman Thanks!
This is my config, not working at all here:

[buildout]
extends = staging.cfg
parts = instance instance-slave zeo zeo-slave

var-directory = ${buildout:directory}/var

eggs =
    Plone
    Pillow
    Products.PloneHotfix20200121

[instancecommon]
recipe = plone.recipe.zope2instance
user = admin:admin
var = ${buildout:var-directory}
debug-mode = off
verbose-security = off
ip-address = 127.0.0.1
zodb-cache-size = 50000
zeo-client-cache-size = 250MB
zserver-threads = 2
eggs = ${buildout:eggs}
zcml = fzj.intranet
zeo-client = true
#zeo-address = ${zeo:zeo-address}
zeo-client-client = ${:_buildout_section_name_}
zeo-client-drop-cache-rather-verify = true
event-log-level = WARN
event-log-max-size = 50MB
event-log-old-files = 4
z2-log-level = WARN
access-log-max-size = 50MB
access-log-old-files = 4
shared-blob = on
http-force-connection-close = true
http-fast-listen = off
environment-vars =
    zope_i18n_compile_mo_files true
zope-conf-additional =
    trusted-proxy 127.0.0.1
zcml-additional =

[instance]
<=instancecommon
ip-address = 127.0.0.1
http-address = 9001
zeo-address = localhost:8001
zeo-client-client = ${:_buildout_section_name_}

[instance-slave]
<=instancecommon
ip-address = 127.0.0.1
http-address = 9002
zeo-address = localhost:8002
zeo-client-client = ${:_buildout_section_name_}
read-only = True

[zeo]
recipe = plone.recipe.zeoserver[zrs]
zeo-address = 8001
var = ${buildout:var-directory}
pack-days = 7
pack-keep-old = false
replicate-to = 5000

[zeo-slave]
recipe = plone.recipe.zeoserver[zrs]
zeo-address = 8002
var = ${buildout:directory}/var-slave
pack-days = 7
pack-keep-old = false
replicate-from = localhost:5000

Using Plone 5.2 Python3.7, it just ignores the replication:

2020-06-05T15:25:30 (92069) created PID file '/Users/sneridagh/Development/kitconcept/api/var-slave/zeo-slave.pid'
2020-06-05T15:25:30 (92069) opening storage '1' using ZRS
2020-06-05T15:25:30 Ignoring index for /Users/sneridagh/Development/kitconcept/api/var-slave/filestorage/Data.fs
2020-06-05T15:25:30 Opening /Users/sneridagh/Development/kitconcept/api/var-slave/filestorage/Data.fs ('localhost', 5000)
2020-06-05T15:25:30 Starting factory <zc.zrs.secondary.SecondaryFactory object at 0x106c5e090>
2020-06-05T15:25:30 IPv4Address(type='TCP', host='127.0.0.1', port=5000): Connected
2020-06-05T15:25:30 IPv4Address(type='TCP', host='127.0.0.1', port=5000): Disconnected <twisted.python.failure.Failure twisted.internet.error.ConnectionDone: Connection was closed cleanly.>
2020-06-05T15:25:30 Stopping factory <zc.zrs.secondary.SecondaryFactory object at 0x106c5e090>
2020-06-05T15:25:30 StorageServer created RW with storages: 1:RO:/Users/sneridagh/Development/kitconcept/api/var-slave/filestorage/Data.fs
2020-06-05T15:25:30 listening on ('', 8002)
2020-06-05T15:26:30 Starting factory <zc.zrs.secondary.SecondaryFactory object at 0x106c5e090>
2020-06-05T15:26:30 IPv4Address(type='TCP', host='127.0.0.1', port=5000): Connected
2020-06-05T15:26:30 IPv4Address(type='TCP', host='127.0.0.1', port=5000): Disconnected <twisted.python.failure.Failure twisted.internet.error.ConnectionDone: Connection was closed cleanly.>
2020-06-05T15:26:30 Stopping factory <zc.zrs.secondary.SecondaryFactory object at 0x106c5e090>
2020-06-05T15:27:30 Starting factory <zc.zrs.secondary.SecondaryFactory object at 0x106c5e090>
2020-06-05T15:27:30 IPv4Address(type='TCP', host='127.0.0.1', port=5000): Connected
2020-06-05T15:27:30 IPv4Address(type='TCP', host='127.0.0.1', port=5000): Disconnected <twisted.python.failure.Failure twisted.internet.error.ConnectionDone: Connection was closed cleanly.>
2020-06-05T15:27:30 Stopping factory <zc.zrs.secondary.SecondaryFactory object at 0x106c5e090>

I don't see a PrimaryFactory beeing created in your logs.

From the docs:

replicate-to
host:port combination this ZRS should listen to as a primary. ZRS Secondaries connect here to get replication data.

You only have a port defined, not the host:port combination. Haven't looked at the recipe code yet, but could be one source of error.

1 Like

@tmassman Finally, it worked! Thanks, that last message helped me. It seems the port 5000 is occupied by something else in MacOS, then it conflicted.

I set it in port 8999 and worked well. Thanks for the support!
V.

FTR:

[buildout]
extends = staging.cfg
parts = instance instance-slave zeo zeo-slave

var-directory = ${buildout:directory}/var

eggs =
    Plone
    Pillow
    Products.PloneHotfix20200121

[instancecommon]
recipe = plone.recipe.zope2instance
user = admin:admin
var = ${buildout:var-directory}
debug-mode = off
verbose-security = off
ip-address = 127.0.0.1
zodb-cache-size = 50000
zeo-client-cache-size = 250MB
zserver-threads = 2
eggs = ${buildout:eggs}
zcml = fzj.intranet
zeo-client = true
#zeo-address = ${zeo:zeo-address}
zeo-client-client = ${:_buildout_section_name_}
zeo-client-drop-cache-rather-verify = true
event-log-level = WARN
event-log-max-size = 50MB
event-log-old-files = 4
z2-log-level = WARN
access-log-max-size = 50MB
access-log-old-files = 4
shared-blob = on
http-force-connection-close = true
http-fast-listen = off
environment-vars =
    zope_i18n_compile_mo_files true
zope-conf-additional =
    trusted-proxy 127.0.0.1
zcml-additional =

[instance]
<=instancecommon
ip-address = 127.0.0.1
http-address = 9001
zeo-address = localhost:8001
zeo-client-client = ${:_buildout_section_name_}

[instance-slave]
<=instancecommon
ip-address = 127.0.0.1
http-address = 9002
zeo-address = localhost:8002
zeo-client-client = ${:_buildout_section_name_}
read-only = True

[zeo]
recipe = plone.recipe.zeoserver[zrs]
zeo-address = 8001
var = ${buildout:var-directory}
pack-days = 7
pack-keep-old = false
replicate-to = 8999

[zeo-slave]
recipe = plone.recipe.zeoserver[zrs]
zeo-address = 8002
var = ${buildout:directory}/var-slave
pack-days = 7
pack-keep-old = false
replicate-from = localhost:8999
4 Likes

Plone Foundation Code of Conduct