We assume that you are starting with a standalone unified installer based configuration.
Add the following files to your buildout and edit the extends section of your buildout accordingly. Then run bin/buildout -Nvv.... You may customize the ports on which each service runs in the zeo.cfg. The result will be an haproxy balanced cluster of two zeo clients.
From your buildout folder run the following command:
wget -qO- https://goo.gl/Svv16i | bash
OR
Clone the repo:
git clone git@gist.github.com:5ea6ecf1e843f152a63c.git
cp 5ea6ecf1e843f152a63c/* ./
OR
Download the gist into your buildout folder:
wget https://gist.github.com/pigeonflight/5ea6ecf1e843f152a63c/archive/ad7afbdbe00b5c5ce6802115d631e3f10beeaa39.zip
unzip ad7afbdbe00b5c5ce6802115d631e3f10beeaa39.zip
mv 5ea6ecf1e843f152a63c-ad7afbdbe00b5c5ce6802115d631e3f10beeaa39/* ./
And edit your buildout.cfg file by changing it in three locations.
Near line 38 (if you used the UI installer) add zeo.cfg, haproxy.cfg and supervisor.cfg:
extends = base.cfg versions.cfg # http://dist.plone.org/release/5.0/versions.cfg zeo.cfg haproxy.cfg supervisord.cfg
Near line 146 (if you used the UI installer) change parts = to parts += and comment out instance or remove it:
parts += # instance repozo backup zopepy unifiedinstaller
- In the [instance] section make sure there's a zcml = 1 section even if it is an empty section.
Then run buildout:
bin/buildout
bin/supervisord
bin/supervisorctl shutdown all
Restart everything:
bin/supervisorctl restart all
restart one thing e.g. zeo:
bin/supervisorctl restart zeo
On c9 your service MUST run on port 8080.
Edit zeo.cfg to change the default ports (you'll want haproxy to run on port 8080 if you are completely replacing the instance)
It will look like this when you're done:
[ports]
zeoserver = 12000
instance1 = 12030
instance2 = 12031
instance-debug = 12038
haproxy = 8080
Tne rerun buildout to update the configuration:
bin/buildout
You can reread your supervisor config and restart as follows:
bin/supervisorctl reread
bin/supervisorctl update