{"id":21662742,"url":"https://github.com/codesyntax/buildout.zrsexample","last_synced_at":"2026-05-20T14:07:27.341Z","repository":{"id":145195688,"uuid":"13722190","full_name":"codesyntax/buildout.zrsexample","owner":"codesyntax","description":"Example buildout with ZRS, HAProxy and Varnish","archived":false,"fork":false,"pushed_at":"2015-02-13T11:21:17.000Z","size":121,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-20T05:48:42.319Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codesyntax.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-10-20T16:19:54.000Z","updated_at":"2015-02-13T11:21:17.000Z","dependencies_parsed_at":"2023-03-26T16:35:03.892Z","dependency_job_id":null,"html_url":"https://github.com/codesyntax/buildout.zrsexample","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/codesyntax/buildout.zrsexample","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codesyntax%2Fbuildout.zrsexample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codesyntax%2Fbuildout.zrsexample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codesyntax%2Fbuildout.zrsexample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codesyntax%2Fbuildout.zrsexample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codesyntax","download_url":"https://codeload.github.com/codesyntax/buildout.zrsexample/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codesyntax%2Fbuildout.zrsexample/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259952457,"owners_count":22936956,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-25T10:17:54.523Z","updated_at":"2026-05-20T14:07:27.292Z","avatar_url":"https://github.com/codesyntax.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"buildout.zrsexample\n====================\n\nExample buildout with ZRS, HAProxy and Varnish\n\nBackground\n----------------\n\nRecently [ZC](http://www.zope.com) released\n[ZRS](https://pypi.python.org/pypi/zc.zrs), their ZEO replication service,\nunder a [ZPL license](http://foundation.zope.org/agreements/ZPL_2.1.pdf).\n\nSoon after a new release of [plone.recipe.zeoserver](https://pypi.python.org/pypi/plone.recipe.zeoserver)\nwas prepared with a great feature: support for zc.zrs. As noted by\n[Steve McMahon](http://www.stevemcmahon.com/steves-blog/plone-adds-replication-in-micro-release)\nthis was a very big feature for a small release, because not only provides\na way to backup your ZEO server live, but also provides a way to create\nextra ZEO servers and they can also be configured to serve content.\n\n\nExample configuration with buildout\n-----------------------------------------\n\nThis buildout shows an example to create such a configuration. It also provides\nconfiguration for HAProxy and Varnish if you want to serve everything\nfrom one server.\n\nTo get this configuration running, just execute this buildout with python 2.7 and\nstart the supervisor:\n\n\n    $ python2.7 bootstrap.py\n    $ ./bin/buildout -vv\n    $ ./bin/supervisord\n\n\nIt will create a configuration like this one:\n\n    -----------------------------\u003e Instance1 (:8081) \u003c--\u003e ZEO1 (:8091, replicate in :8070)\n                                                                         |        |\n                                                                         |        |\n        Varnish --\u003e HAProxy -----\u003e Instance2* (:8082) \u003c--\u003e ZEO2* (:8092)--        |\n        (:8000)     (:8080)  |                                                    |\n                             |                                                    |\n                             |---\u003e Instance3* (:8083) \u003c--\u003e ZEO3* (:8093)----------\n\n     Instances with * are set to be read-only\n\n\n\n### What do you get with this?\n\n\nWith this configuration you have a common Zope instance with a ZEO server to\ndo your content-editing work. This happens in the 8081 port instance.\n\nBut, for free, you also get 2 more instances, balanced using HAProxy and cached\nin Varnish, configured in read-only and each one with their own ZEO instance\nwhich gets the data from the first ZEO server. But this instances are configured\nin read-only mode, so you can't write on them. If your site just has to serve\ncontent, it can work in read-only mode and you get that the editing and content\nviewing don't happen at the same time on the same server.\n\nYou will need to configure your webserver to serve the first instance in another\ndomain (for instance edit.yourserver.com) and server the main domain (www.yourserver.com)\nthrough Varnish. Varnish is not mandatory, you can just connect you webserver\nto HAProxy.\n\nIf you are using Nginx, you can adapt [this configuration](http://www.starzel.de/blog/securing-plone-sites-with-https-and-nginx)\nprepared by [Philip Bauer](https://twitter.com/StarzelDe) which originaly was\ncreated to put all logged-in traffic under HTTPS- You can easily adapt it to put\nall your logged-in traffic to 8081 port and the not-logged one to 8000\n(or 8080 if you want to avoid Varnish)\n\nFurther steps\n--------------\n\nYou can easily add new instances connected to ZEO2 and ZEO3, just copy the\nbuildout parts, and adjust the conf/haproxy.conf.in file to add more instances\nto the load-balancing process.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodesyntax%2Fbuildout.zrsexample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodesyntax%2Fbuildout.zrsexample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodesyntax%2Fbuildout.zrsexample/lists"}