

Plone 4.3.2 adds support for zrs/zodb replication - e12e
http://www.stevemcmahon.com/steves-blog/plone-adds-replication-in-micro-release

======
e12e
This is pretty neat - a quick tests seems to show that it works fine:

    
    
        # Get a few libraries etc. In particular we need
        # dev packages for python, and libjpeg
        sudo apt-get build-dep zope2.12
        sudo aptitude install python-virtualenv
        mkdir plone-test
        cd plone-test
        virtualenv -p python2.6 --no-site-packages --distribute py2.6-venv
        ./py2.6-venv/pip install -U distribute
        mkdir buildout
        cd buildout
    

Then set up a buildout.cfg, I think this is pretty minimal:

    
    
        [buildout]
        extends = http://dist.plone.org/release/4.3.2/versions.cfg
        versions = versions
        parts =
          zeo-master
          zeo-slave
          plone-master-client
          plone-write-client2
          plone-slave-client
          plone-read-client2
    
        # This is a client that can write to the database
        # note that the admin login is set to: admin:admin
        [plone-master-client]
        recipe = plone.recipe.zope2instance
        user = admin:admin
        http-address = 7000
        zeo-client = on
        zeo-address = ${zeo-master:zeo-address}
        eggs =
            Pillow
            Plone
    
        # This is "traditional" Plone clustering:
        # additional write client front-end - *single* db backend
        [plone-write-client2]
        recipe = plone.recipe.zope2instance
        user = ${plone-master-client:user}
        http-address = 7002
        zeo-client = on
        zeo-address = ${zeo-master:zeo-address}
        eggs = ${plone-master-client:eggs}
    
        # This is a client on our read-only slave. We
        # cannot write (eg: edit contet, define sites)
        # through this - but it works for reading
        [plone-slave-client]
        recipe = plone.recipe.zope2instance
        user = ${plone-master-client:user}
        http-address = 7001
        zeo-client = on
        zeo-address = ${zeo-slave:zeo-address}
        eggs = ${plone-master-client:eggs}
        read-only = true
    
        # We can cluster clients on the read-only backend
        [plone-read-client2]
        recipe = plone.recipe.zope2instance
        user = ${plone-master-client:user}
        http-address = 7003
        zeo-client = on
        zeo-address = ${zeo-slave:zeo-address}
        eggs = ${plone-master-client:eggs}
        read-only = true
    
        # Our standard read-write zeo-backend
        # note that we can see some simple statistics
        # on http://127.0.0.1:8110
        [zeo-master]
        recipe = plone.recipe.zeoserver[zrs]
        replicate-to = 127.0.0.1:8101
        monitor-address = 127.0.0.1:8110
        zeo-address = 127.0.0.1:8100
    
        # Sample config for read-only slave zeo
        # Note that all run-time info, data etc
        # is stored under "var2" as opposed to the default
        # "var" for our zeo instance above.
        [zeo-slave]
        recipe = plone.recipe.zeoserver[zrs]
        zeo-address = 127.0.0.1:8200
        replicate-from = ${zeo-master:replicate-to}
        var = ${buildout:directory}/var2
        read-only = true
    

Get bootstrap, bootstrap and install plone:

    
    
        curl -O https://raw.github.com/buildout/buildout/2/bootstrap/bootstrap.py
        ../py2.6-venv/bin/python bootstrap.py
        ./bin/buildout # This will take some time, make a coffee
    

Start up the parts:

    
    
        ./bin/zeo-master start
        ./bin/zeo-slave start
        ./bin/plone-master-client start
        ./bin/plone-slave-client start
        ./bin/plone-read-client2  start
        ./bin/plone-write-client2 start
        

Now, you can open [http://127.0.0.1:8110](http://127.0.0.1:8110) to look at
some stats from the master, and create a site with one of the read-write-
clients, eg: [http://127.0.0.1:7000](http://127.0.0.1:7000) \-- and watch the
changes appear on the read-only-client:
[http://127.0.0.1:7001](http://127.0.0.1:7001).

~~~
e12e
Some more links:

[https://github.com/plone/plone.recipe.zeoserver](https://github.com/plone/plone.recipe.zeoserver)
[https://pypi.python.org/pypi/plone.recipe.zeoserver](https://pypi.python.org/pypi/plone.recipe.zeoserver)

