[8035] | 1 | Deploying waeup.uniben as ZEO-install |
---|
| 2 | ************************************* |
---|
| 3 | |
---|
| 4 | Each ZEO install consists of at least one ZEO server and normally two |
---|
| 5 | or more ZEO clients. While the ZEO server is meant to manage the ZODB |
---|
| 6 | database for clients, the clients connect to the outside world, listen |
---|
| 7 | for request and do the real dataprocessing. |
---|
| 8 | |
---|
| 9 | We prepared a `buildout` configuration that sets up one server |
---|
| 10 | configuration and two client configs. This configuration is in |
---|
| 11 | ``buildout-zeo.cfg``. |
---|
| 12 | |
---|
| 13 | Generating the ZEO setup |
---|
| 14 | ======================== |
---|
| 15 | |
---|
| 16 | To install waeup.uniben ZEO-based you can run `buildout` with the given |
---|
| 17 | (or your own) configuration file like this:: |
---|
| 18 | |
---|
| 19 | $ ./bin/buildout -c buildout-zeo.cfg |
---|
| 20 | |
---|
| 21 | This should generate all scripts necessary to run servers, clients, |
---|
| 22 | etc. |
---|
| 23 | |
---|
| 24 | Starting ZEO servers and clients |
---|
| 25 | ================================ |
---|
| 26 | |
---|
| 27 | First start the server:: |
---|
| 28 | |
---|
| 29 | $ ./bin/zeo_server start |
---|
| 30 | |
---|
| 31 | Clients can be started by doing:: |
---|
| 32 | |
---|
| 33 | $ ./bin/zeo_client1 start |
---|
| 34 | $ ./bin/zeo_client2 start |
---|
| 35 | |
---|
| 36 | This will start both clients in daemon mode. |
---|
| 37 | |
---|
| 38 | Instead of ``start`` you can, as usually, start an instance in |
---|
| 39 | foreground (``fg``), etc. You know the drill. |
---|
| 40 | |
---|
| 41 | Manually starting ZEO clients |
---|
| 42 | ----------------------------- |
---|
| 43 | |
---|
| 44 | This is normally not neccessary. |
---|
| 45 | |
---|
| 46 | ``zeo_clientN`` scripts are basically wrappers around calls to |
---|
| 47 | ``bin/paster``. You can bypass this wrapper and start a client |
---|
| 48 | 'manually' like this:: |
---|
| 49 | |
---|
| 50 | $ ./bin/paster serve --pid-file var/zeo1.pid --daemon \ |
---|
| 51 | pars/etc/zeo1.ini |
---|
| 52 | |
---|
| 53 | It is important to give a pid-file as paster otherwise can not start |
---|
| 54 | different clients (they would all refer to the same pid file |
---|
| 55 | `paster.pid` and refuse to start after the first client was started). |
---|
| 56 | |
---|
| 57 | |
---|
| 58 | Setup (paramters, ports, etc.) |
---|
| 59 | ============================== |
---|
| 60 | |
---|
| 61 | By default the server will listen on port 8100 for requests from |
---|
| 62 | localhost (not: from the outside world). |
---|
| 63 | |
---|
| 64 | You can change ZEO server settings in the ``[zeo_server]`` section |
---|
| 65 | of ``buildout-zeo.conf``. Run `buildout` afterwards. |
---|
| 66 | |
---|
| 67 | The clients will listen on port 8081 and 8082. You can change settings |
---|
| 68 | in ``etc/zeo1.ini.in`` and ``etc/zeo2.ini.in`` respectively. Run |
---|
| 69 | buildout after any change. |
---|
| 70 | |
---|
| 71 | If you want to change the paster wrapper for any zeo client, you can |
---|
| 72 | edit ``etc/zeo1.conf`` and/or ``etc/zeo2.conf``. Run buildout |
---|
| 73 | afterwards. |
---|
| 74 | |
---|
| 75 | Creating new clients |
---|
| 76 | ==================== |
---|
| 77 | |
---|
| 78 | You want more clients to be created by buildout? Easy. Three steps are |
---|
| 79 | neccessary. |
---|
| 80 | |
---|
| 81 | 1. Create config files in etc/ |
---|
| 82 | ------------------------------ |
---|
| 83 | |
---|
| 84 | Each client needs two configuration files: |
---|
| 85 | |
---|
| 86 | - ``etc/zeoN.conf`` |
---|
| 87 | configuring the paster wrapper |
---|
| 88 | |
---|
| 89 | - ``etc/zeoN.ini`` |
---|
| 90 | configuring the runtime config, ports, etc. |
---|
| 91 | |
---|
| 92 | Just copy over these files from the already existing zeo1/zeo2 files |
---|
| 93 | and replace ``zeo1`` or ``zeo2`` with your new name. |
---|
| 94 | |
---|
| 95 | 2. Update buildout-zeo.cfg |
---|
| 96 | -------------------------- |
---|
| 97 | |
---|
| 98 | Here, inside ``buildourt-zeo.cfg`` also three steps are needed. |
---|
| 99 | |
---|
| 100 | * 2.1. Create new .ini and .conf entries |
---|
| 101 | |
---|
| 102 | The .conf and .ini files in etc/ are only templates that have to be |
---|
| 103 | generated in their really used final location. In buildout-zeo.cfg |
---|
| 104 | you can care for this by creating a new ``[zeoN_ini]`` and |
---|
| 105 | ``[zeoN_conf]`` option (replacing ``N`` with a number, of course). |
---|
| 106 | |
---|
| 107 | Just copy over existing entries and replace the mentions of ``zeo1`` |
---|
| 108 | or ``zeo2`` by your ``zeoN``. |
---|
| 109 | |
---|
| 110 | * 2.2. Create a new ``zeo_clientN`` entry |
---|
| 111 | |
---|
| 112 | Then you have to create an entry that will generate the |
---|
| 113 | ``zeo_clientN`` script. Again, just copy over an existing |
---|
| 114 | ``[zeo_client1]`` entry and replace ``1`` withg your client number. |
---|
| 115 | |
---|
| 116 | * 2.3. Register the new sections in ``[buildout]`` section |
---|
| 117 | |
---|
| 118 | When done with the above: add the new section in ``[buildout]``:: |
---|
| 119 | |
---|
| 120 | [buildout] |
---|
| 121 | ... |
---|
| 122 | <old entries...> |
---|
| 123 | ... |
---|
| 124 | zope_conf_zeo_5 |
---|
| 125 | zeo5_ini |
---|
| 126 | zeo_client5 |
---|
| 127 | |
---|
| 128 | depending on how you named your new sections. |
---|
| 129 | |
---|
| 130 | 3. Rerun ``buildout`` |
---|
| 131 | --------------------- |
---|
| 132 | |
---|
| 133 | When adding or removing client/server instances, make sure to stop all |
---|
| 134 | running servers/clients before rerunning buildout. |
---|
| 135 | |
---|
| 136 | To activate the new setup, rerun buildout:: |
---|
| 137 | |
---|
| 138 | $ bin/buildout -c buildout-zeo.cfg |
---|
| 139 | |
---|
| 140 | This should generate any new clients and remove older ones or just |
---|
| 141 | update configuration files. |
---|
| 142 | |
---|
| 143 | |
---|
| 144 | Considerations |
---|
| 145 | ============== |
---|
| 146 | |
---|
| 147 | There are some things in the current buildout-zeo.cfg we might do not |
---|
| 148 | want. It extends the regular ``buildout.cfg`` so that we do not have |
---|
| 149 | to repeat most sections but the ``parts`` in ``[buildout]`` have to be |
---|
| 150 | listed. |
---|
| 151 | |
---|
| 152 | We need, however, not everything with a ZEO-deploy that is listed in a |
---|
| 153 | default buildout. We might do not need docs, no profiling, etc. Also a |
---|
| 154 | regular non-ZEO kofactl might not make to much sense. Therefore all |
---|
| 155 | this might be subject to changes. |
---|
| 156 | |
---|