JotaMG
JotaMG

Reputation: 31

Information about how to setup Plone ZRS and replication?

is there any docs / tutorial about how to setup ZRS ? I can't find anything useful...

ZRS replicates the whole data.fs, is that right?

is there any way / solution to only replicate and keep in sync parts of the instance (folders) ?

Upvotes: 1

Views: 147

Answers (1)

Ulrich Schwarz
Ulrich Schwarz

Reputation: 7727

Once you've done it, it goes from "black magic" to "not much to say", really. As you've probably noted, the latest versions are incompatible with Plone's older Zope version, so you need to pin to

zc.zrs == 2.4.4

and in the usecase I have here (which includes zlibstorage), the single stanzas in zeo-conf-additional look like this on the server:

<serverzlibstorage demo>
    <zrs demo-Z>
    replicate-to 41002
        <filestorage demo-ZR>
            path     ${buildout:zeo-datadir}/filestorage/${buildout:instancename}/demo.fs
            blob-dir ${buildout:zeo-datadir}/blobstorage/${buildout:instancename}/demo
        </filestorage>
    </zrs>
</serverzlibstorage>

like this on the replicate:

<serverzlibstorage demo>
    <zrs demo-Z>
    replicate-from ${buildout:zeo-host}:41002
    keep-alive-delay 60
        <filestorage demo-ZR>
            path     ${buildout:zeo-datadir}/filestorage/${buildout:instancename}/demo.fs
            blob-dir ${buildout:zeo-datadir}/blobstorage/${buildout:instancename}/demo
        </filestorage>
    </zrs>
</serverzlibstorage>

and like this on the client in zope-conf-additional:

<zodb_db demo>
    cache-size 9000
    <zlibstorage>
    <zeoclient>
        server ${buildout:zeo-host}:${buildout:zeo-port}
        # backup:
        server ${buildout:clone-host}:${buildout:clone-port}
        read-only-fallback True
        storage demo
        name demo
        # [...]
    </zeoclient>
    </zlibstorage>
    mount-point /fs-demo
</zodb_db>

But, as you remark, you can only replicate entire databases, and from what I gather, the general consensus in the Plone community is that having multiple databases (even one per Plone instance) is very much not a recommended use-case anymore.

Upvotes: 2

Related Questions