1 | <?xml version="1.0" encoding="utf-8" ?> |
---|
2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
---|
3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
---|
4 | <head> |
---|
5 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
---|
6 | <meta name="generator" content="Docutils 0.8.1: http://docutils.sourceforge.net/" /> |
---|
7 | <title>Installation of Kofa on Linux production system</title> |
---|
8 | <style type="text/css"> |
---|
9 | |
---|
10 | /* |
---|
11 | :Author: David Goodger (goodger@python.org) |
---|
12 | :Id: $Id: html4css1.css 7056 2011-06-17 10:50:48Z milde $ |
---|
13 | :Copyright: This stylesheet has been placed in the public domain. |
---|
14 | |
---|
15 | Default cascading style sheet for the HTML output of Docutils. |
---|
16 | |
---|
17 | See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to |
---|
18 | customize this style sheet. |
---|
19 | */ |
---|
20 | |
---|
21 | /* used to remove borders from tables and images */ |
---|
22 | .borderless, table.borderless td, table.borderless th { |
---|
23 | border: 0 } |
---|
24 | |
---|
25 | table.borderless td, table.borderless th { |
---|
26 | /* Override padding for "table.docutils td" with "! important". |
---|
27 | The right padding separates the table cells. */ |
---|
28 | padding: 0 0.5em 0 0 ! important } |
---|
29 | |
---|
30 | .first { |
---|
31 | /* Override more specific margin styles with "! important". */ |
---|
32 | margin-top: 0 ! important } |
---|
33 | |
---|
34 | .last, .with-subtitle { |
---|
35 | margin-bottom: 0 ! important } |
---|
36 | |
---|
37 | .hidden { |
---|
38 | display: none } |
---|
39 | |
---|
40 | a.toc-backref { |
---|
41 | text-decoration: none ; |
---|
42 | color: black } |
---|
43 | |
---|
44 | blockquote.epigraph { |
---|
45 | margin: 2em 5em ; } |
---|
46 | |
---|
47 | dl.docutils dd { |
---|
48 | margin-bottom: 0.5em } |
---|
49 | |
---|
50 | object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] { |
---|
51 | overflow: hidden; |
---|
52 | } |
---|
53 | |
---|
54 | /* Uncomment (and remove this text!) to get bold-faced definition list terms |
---|
55 | dl.docutils dt { |
---|
56 | font-weight: bold } |
---|
57 | */ |
---|
58 | |
---|
59 | div.abstract { |
---|
60 | margin: 2em 5em } |
---|
61 | |
---|
62 | div.abstract p.topic-title { |
---|
63 | font-weight: bold ; |
---|
64 | text-align: center } |
---|
65 | |
---|
66 | div.admonition, div.attention, div.caution, div.danger, div.error, |
---|
67 | div.hint, div.important, div.note, div.tip, div.warning { |
---|
68 | margin: 2em ; |
---|
69 | border: medium outset ; |
---|
70 | padding: 1em } |
---|
71 | |
---|
72 | div.admonition p.admonition-title, div.hint p.admonition-title, |
---|
73 | div.important p.admonition-title, div.note p.admonition-title, |
---|
74 | div.tip p.admonition-title { |
---|
75 | font-weight: bold ; |
---|
76 | font-family: sans-serif } |
---|
77 | |
---|
78 | div.attention p.admonition-title, div.caution p.admonition-title, |
---|
79 | div.danger p.admonition-title, div.error p.admonition-title, |
---|
80 | div.warning p.admonition-title { |
---|
81 | color: red ; |
---|
82 | font-weight: bold ; |
---|
83 | font-family: sans-serif } |
---|
84 | |
---|
85 | /* Uncomment (and remove this text!) to get reduced vertical space in |
---|
86 | compound paragraphs. |
---|
87 | div.compound .compound-first, div.compound .compound-middle { |
---|
88 | margin-bottom: 0.5em } |
---|
89 | |
---|
90 | div.compound .compound-last, div.compound .compound-middle { |
---|
91 | margin-top: 0.5em } |
---|
92 | */ |
---|
93 | |
---|
94 | div.dedication { |
---|
95 | margin: 2em 5em ; |
---|
96 | text-align: center ; |
---|
97 | font-style: italic } |
---|
98 | |
---|
99 | div.dedication p.topic-title { |
---|
100 | font-weight: bold ; |
---|
101 | font-style: normal } |
---|
102 | |
---|
103 | div.figure { |
---|
104 | margin-left: 2em ; |
---|
105 | margin-right: 2em } |
---|
106 | |
---|
107 | div.footer, div.header { |
---|
108 | clear: both; |
---|
109 | font-size: smaller } |
---|
110 | |
---|
111 | div.line-block { |
---|
112 | display: block ; |
---|
113 | margin-top: 1em ; |
---|
114 | margin-bottom: 1em } |
---|
115 | |
---|
116 | div.line-block div.line-block { |
---|
117 | margin-top: 0 ; |
---|
118 | margin-bottom: 0 ; |
---|
119 | margin-left: 1.5em } |
---|
120 | |
---|
121 | div.sidebar { |
---|
122 | margin: 0 0 0.5em 1em ; |
---|
123 | border: medium outset ; |
---|
124 | padding: 1em ; |
---|
125 | background-color: #ffffee ; |
---|
126 | width: 40% ; |
---|
127 | float: right ; |
---|
128 | clear: right } |
---|
129 | |
---|
130 | div.sidebar p.rubric { |
---|
131 | font-family: sans-serif ; |
---|
132 | font-size: medium } |
---|
133 | |
---|
134 | div.system-messages { |
---|
135 | margin: 5em } |
---|
136 | |
---|
137 | div.system-messages h1 { |
---|
138 | color: red } |
---|
139 | |
---|
140 | div.system-message { |
---|
141 | border: medium outset ; |
---|
142 | padding: 1em } |
---|
143 | |
---|
144 | div.system-message p.system-message-title { |
---|
145 | color: red ; |
---|
146 | font-weight: bold } |
---|
147 | |
---|
148 | div.topic { |
---|
149 | margin: 2em } |
---|
150 | |
---|
151 | h1.section-subtitle, h2.section-subtitle, h3.section-subtitle, |
---|
152 | h4.section-subtitle, h5.section-subtitle, h6.section-subtitle { |
---|
153 | margin-top: 0.4em } |
---|
154 | |
---|
155 | h1.title { |
---|
156 | text-align: center } |
---|
157 | |
---|
158 | h2.subtitle { |
---|
159 | text-align: center } |
---|
160 | |
---|
161 | hr.docutils { |
---|
162 | width: 75% } |
---|
163 | |
---|
164 | img.align-left, .figure.align-left, object.align-left { |
---|
165 | clear: left ; |
---|
166 | float: left ; |
---|
167 | margin-right: 1em } |
---|
168 | |
---|
169 | img.align-right, .figure.align-right, object.align-right { |
---|
170 | clear: right ; |
---|
171 | float: right ; |
---|
172 | margin-left: 1em } |
---|
173 | |
---|
174 | img.align-center, .figure.align-center, object.align-center { |
---|
175 | display: block; |
---|
176 | margin-left: auto; |
---|
177 | margin-right: auto; |
---|
178 | } |
---|
179 | |
---|
180 | .align-left { |
---|
181 | text-align: left } |
---|
182 | |
---|
183 | .align-center { |
---|
184 | clear: both ; |
---|
185 | text-align: center } |
---|
186 | |
---|
187 | .align-right { |
---|
188 | text-align: right } |
---|
189 | |
---|
190 | /* reset inner alignment in figures */ |
---|
191 | div.align-right { |
---|
192 | text-align: inherit } |
---|
193 | |
---|
194 | /* div.align-center * { */ |
---|
195 | /* text-align: left } */ |
---|
196 | |
---|
197 | ol.simple, ul.simple { |
---|
198 | margin-bottom: 1em } |
---|
199 | |
---|
200 | ol.arabic { |
---|
201 | list-style: decimal } |
---|
202 | |
---|
203 | ol.loweralpha { |
---|
204 | list-style: lower-alpha } |
---|
205 | |
---|
206 | ol.upperalpha { |
---|
207 | list-style: upper-alpha } |
---|
208 | |
---|
209 | ol.lowerroman { |
---|
210 | list-style: lower-roman } |
---|
211 | |
---|
212 | ol.upperroman { |
---|
213 | list-style: upper-roman } |
---|
214 | |
---|
215 | p.attribution { |
---|
216 | text-align: right ; |
---|
217 | margin-left: 50% } |
---|
218 | |
---|
219 | p.caption { |
---|
220 | font-style: italic } |
---|
221 | |
---|
222 | p.credits { |
---|
223 | font-style: italic ; |
---|
224 | font-size: smaller } |
---|
225 | |
---|
226 | p.label { |
---|
227 | white-space: nowrap } |
---|
228 | |
---|
229 | p.rubric { |
---|
230 | font-weight: bold ; |
---|
231 | font-size: larger ; |
---|
232 | color: maroon ; |
---|
233 | text-align: center } |
---|
234 | |
---|
235 | p.sidebar-title { |
---|
236 | font-family: sans-serif ; |
---|
237 | font-weight: bold ; |
---|
238 | font-size: larger } |
---|
239 | |
---|
240 | p.sidebar-subtitle { |
---|
241 | font-family: sans-serif ; |
---|
242 | font-weight: bold } |
---|
243 | |
---|
244 | p.topic-title { |
---|
245 | font-weight: bold } |
---|
246 | |
---|
247 | pre.address { |
---|
248 | margin-bottom: 0 ; |
---|
249 | margin-top: 0 ; |
---|
250 | font: inherit } |
---|
251 | |
---|
252 | pre.literal-block, pre.doctest-block, pre.math { |
---|
253 | margin-left: 2em ; |
---|
254 | margin-right: 2em } |
---|
255 | |
---|
256 | span.classifier { |
---|
257 | font-family: sans-serif ; |
---|
258 | font-style: oblique } |
---|
259 | |
---|
260 | span.classifier-delimiter { |
---|
261 | font-family: sans-serif ; |
---|
262 | font-weight: bold } |
---|
263 | |
---|
264 | span.interpreted { |
---|
265 | font-family: sans-serif } |
---|
266 | |
---|
267 | span.option { |
---|
268 | white-space: nowrap } |
---|
269 | |
---|
270 | span.pre { |
---|
271 | white-space: pre } |
---|
272 | |
---|
273 | span.problematic { |
---|
274 | color: red } |
---|
275 | |
---|
276 | span.section-subtitle { |
---|
277 | /* font-size relative to parent (h1..h6 element) */ |
---|
278 | font-size: 80% } |
---|
279 | |
---|
280 | table.citation { |
---|
281 | border-left: solid 1px gray; |
---|
282 | margin-left: 1px } |
---|
283 | |
---|
284 | table.docinfo { |
---|
285 | margin: 2em 4em } |
---|
286 | |
---|
287 | table.docutils { |
---|
288 | margin-top: 0.5em ; |
---|
289 | margin-bottom: 0.5em } |
---|
290 | |
---|
291 | table.footnote { |
---|
292 | border-left: solid 1px black; |
---|
293 | margin-left: 1px } |
---|
294 | |
---|
295 | table.docutils td, table.docutils th, |
---|
296 | table.docinfo td, table.docinfo th { |
---|
297 | padding-left: 0.5em ; |
---|
298 | padding-right: 0.5em ; |
---|
299 | vertical-align: top } |
---|
300 | |
---|
301 | table.docutils th.field-name, table.docinfo th.docinfo-name { |
---|
302 | font-weight: bold ; |
---|
303 | text-align: left ; |
---|
304 | white-space: nowrap ; |
---|
305 | padding-left: 0 } |
---|
306 | |
---|
307 | h1 tt.docutils, h2 tt.docutils, h3 tt.docutils, |
---|
308 | h4 tt.docutils, h5 tt.docutils, h6 tt.docutils { |
---|
309 | font-size: 100% } |
---|
310 | |
---|
311 | ul.auto-toc { |
---|
312 | list-style-type: none } |
---|
313 | |
---|
314 | </style> |
---|
315 | </head> |
---|
316 | <body> |
---|
317 | <div class="document" id="installation-of-kofa-on-linux-production-system"> |
---|
318 | <h1 class="title">Installation of Kofa on Linux production system</h1> |
---|
319 | |
---|
320 | <div class="note"> |
---|
321 | <p class="first admonition-title">Note</p> |
---|
322 | <p class="last"><cite>waeup.kofa</cite> and its custom packages |
---|
323 | might not work with Python > 2.7 |
---|
324 | currently. Use of Python 2.7 is recommended. |
---|
325 | The installation is described for Linux-based computers.</p> |
---|
326 | </div> |
---|
327 | <div class="section" id="part-1-deploying-kofa-as-a-single-zope-client-install"> |
---|
328 | <h1>Part 1: Deploying Kofa as a single Zope client install</h1> |
---|
329 | <div class="section" id="prerequisites"> |
---|
330 | <h2>Prerequisites</h2> |
---|
331 | <p>The Kofa packages are based on <a class="reference external" href="http://grok.zope.org/">Grok</a>, which is a Python |
---|
332 | framework for agile webapplication development. Grok itself is based |
---|
333 | on <a class="reference external" href="http://www.zope.org/">Zope</a>.</p> |
---|
334 | <p>Both, Grok and Zope, are written in Python (with parts written in |
---|
335 | C). You therefore need <a class="reference external" href="http://www.python.org/">Python</a> installed.</p> |
---|
336 | <p>Note, that you also need the Python header files and a compiler to |
---|
337 | compile the parts written in C.</p> |
---|
338 | <p>To deploy Kofa most easily, we use <a class="reference external" href="http://cheeseshop.python.org/pypi/zc.buildout">zc.buildout</a></p> |
---|
339 | </div> |
---|
340 | <div class="section" id="preparing-the-system"> |
---|
341 | <h2>Preparing the system</h2> |
---|
342 | <p>To create a working copy of Kofa we recommend use of |
---|
343 | <cite>virtualenv</cite>. You, however, need also some basic libraries, a C |
---|
344 | compiler and some things more.</p> |
---|
345 | <p>What you need (Debian/Ubuntu package names in brackets):</p> |
---|
346 | <ul> |
---|
347 | <li><p class="first">Python 2.7 (python2.7)</p> |
---|
348 | </li> |
---|
349 | <li><p class="first">Python 2.7 development files (python2.7-dev)</p> |
---|
350 | </li> |
---|
351 | <li><p class="first">A C-Compiler (gcc)</p> |
---|
352 | </li> |
---|
353 | <li><p class="first">The C library development files (libc6-dev)</p> |
---|
354 | </li> |
---|
355 | <li><p class="first">A subversion client (svn)</p> |
---|
356 | </li> |
---|
357 | <li><p class="first">enscript (enscript) [optional]</p> |
---|
358 | <p>This is only needed if you want test coverage reports.</p> |
---|
359 | </li> |
---|
360 | </ul> |
---|
361 | <p>All these packages can be installed on Debian systems like this:</p> |
---|
362 | <pre class="literal-block"> |
---|
363 | # apt-get install python2.7 python2.7-dev python2.7-dbg \ |
---|
364 | gcc libc6-dev svn enscript |
---|
365 | </pre> |
---|
366 | <p>Afterwards you should be able to enter:</p> |
---|
367 | <pre class="literal-block"> |
---|
368 | $ python2.7 |
---|
369 | </pre> |
---|
370 | <p>at the commandline and get a Python prompt. Quit the interpreter |
---|
371 | pressing <CTRL-D>.</p> |
---|
372 | </div> |
---|
373 | <div class="section" id="installing-virtualenv"> |
---|
374 | <h2>Installing <cite>virtualenv</cite></h2> |
---|
375 | <p>We recommend use of <cite>virtualenv</cite> to create Python sandboxes where you |
---|
376 | can run your code without touching any other installations.</p> |
---|
377 | <p>If you don't already have <tt class="docutils literal">easy_install</tt> available, you can find the |
---|
378 | script to set it up on the <a class="reference external" href="http://peak.telecommunity.com/DevCenter/EasyInstall#installing-easy-install">PEAK EasyInstall page</a>.</p> |
---|
379 | <p>You need to download <a class="reference external" href="http://peak.telecommunity.com/dist/ez_setup.py">ez_setup.py</a>. Then, you run it like this to |
---|
380 | install <tt class="docutils literal">easy_install</tt> into your system Python:</p> |
---|
381 | <pre class="literal-block"> |
---|
382 | $ sudo python2.7 ez_setup.py |
---|
383 | </pre> |
---|
384 | <p>This will make <tt class="docutils literal">easy_install</tt> available to you.</p> |
---|
385 | <div class="note"> |
---|
386 | <p class="first admonition-title">Note</p> |
---|
387 | <p>Sometimes you have <tt class="docutils literal">easy_install</tt> installed but you need a |
---|
388 | newer version of the underlying setuptools infrastructure to |
---|
389 | make Grok work. You can upgrade setuptools with:</p> |
---|
390 | <pre class="last literal-block"> |
---|
391 | $ sudo easy_install -U setuptools |
---|
392 | </pre> |
---|
393 | </div> |
---|
394 | <p>Now you can install <cite>virtualenv</cite> by doing (as root):</p> |
---|
395 | <pre class="literal-block"> |
---|
396 | # easy_install-2.7 virtualenv |
---|
397 | </pre> |
---|
398 | <p>This step will fetch all needed sources from the internet and install |
---|
399 | <cite>virtualenv</cite> locally in your Python2.7 installation.</p> |
---|
400 | </div> |
---|
401 | <div class="section" id="creating-a-sandbox"> |
---|
402 | <h2>Creating a sandbox</h2> |
---|
403 | <p>This step is only necessary (and recommended) if you installed |
---|
404 | <cite>virtualenv</cite> before.</p> |
---|
405 | <p>As a normal user you now can create a sandbox for your upcoming work |
---|
406 | by:</p> |
---|
407 | <pre class="literal-block"> |
---|
408 | $ virtualenv --no-site-packages mysandbox |
---|
409 | </pre> |
---|
410 | <p>where <tt class="docutils literal">mysandbox</tt> is a directory in the filesystem where your |
---|
411 | sandbox will be created. <cite>virtualenv</cite> will also create this directory |
---|
412 | for you.</p> |
---|
413 | <p>By passing the <tt class="docutils literal"><span class="pre">no-site-packages</span></tt> switch we tell <cite>virtualenv</cite> to |
---|
414 | provide us a clean environment without any extra-packages installed |
---|
415 | systemwide.</p> |
---|
416 | <p>You now can activate the sandbox by doing:</p> |
---|
417 | <pre class="literal-block"> |
---|
418 | $ source mysandbox/bin/activate |
---|
419 | </pre> |
---|
420 | <p>You will notice that the input prompt changes.</p> |
---|
421 | <p>To deactivate the sandbox at any time, enter:</p> |
---|
422 | <pre class="literal-block"> |
---|
423 | (sandbox27)$ deactivate |
---|
424 | </pre> |
---|
425 | <p>and the prompt will be the same as before the activation.</p> |
---|
426 | <p>For the following steps make sure the sandbox is active.</p> |
---|
427 | </div> |
---|
428 | <div class="section" id="creating-a-working-place"> |
---|
429 | <h2>Creating a working place</h2> |
---|
430 | <p>In the sandbox we now create our real working |
---|
431 | environment. To do this, we change to the sandbox and checkout the |
---|
432 | sources of Kofa from the subversion server:</p> |
---|
433 | <pre class="literal-block"> |
---|
434 | (sandbox27)$ cd mysandbox/ |
---|
435 | (sandbox27)$ svn co https://svn.waeup.org/repos/main/waeup.kofa/trunk kofa-trunk |
---|
436 | </pre> |
---|
437 | <p>where <tt class="docutils literal"><span class="pre">kofa-trunk</span></tt> is only a name we've chosen here to make clear |
---|
438 | where the sources come from. In this case we are installing the Kofa base |
---|
439 | package.</p> |
---|
440 | <p>The command should fetch the Kofa base package sources for you and |
---|
441 | put it in the directory <tt class="docutils literal"><span class="pre">kofa-trunk/</span></tt>.</p> |
---|
442 | <p>Now enter the new directory:</p> |
---|
443 | <pre class="literal-block"> |
---|
444 | (sandbox27)$ cd kofa-trunk |
---|
445 | </pre> |
---|
446 | </div> |
---|
447 | <div class="section" id="preparing-the-build"> |
---|
448 | <h2>Preparing the build</h2> |
---|
449 | <p>In the sources directory (<tt class="docutils literal"><span class="pre">kofa-trunk/</span></tt>) you have to prepare the |
---|
450 | project to fetch needed components (eggs), compile C-code parts, |
---|
451 | etc. This steip will not touch any external projects:</p> |
---|
452 | <pre class="literal-block"> |
---|
453 | (sandbox27)$ python bootstrap.py |
---|
454 | </pre> |
---|
455 | <p>This will generate some directories and the <tt class="docutils literal">buildout</tt> script in |
---|
456 | <tt class="docutils literal">bin/</tt> for us. This step must be executed only once for each |
---|
457 | instance.</p> |
---|
458 | <p>You can now deactivate the sandbox:</p> |
---|
459 | <pre class="literal-block"> |
---|
460 | (sandbox27)$ deactivate |
---|
461 | </pre> |
---|
462 | <p>Now we can do the real build by triggering:</p> |
---|
463 | <pre class="literal-block"> |
---|
464 | $ bin/buildout |
---|
465 | </pre> |
---|
466 | <p>If this is your first install of some Grok-related project, this step |
---|
467 | will need some time as lots of sources have to be fetched, many |
---|
468 | components must be compiled, etc.</p> |
---|
469 | <p>This step must be redone whenever you change something in |
---|
470 | <tt class="docutils literal">buildout.cfg</tt> or <tt class="docutils literal">setup.py</tt>.</p> |
---|
471 | <p>Note that if you have more than one sandbox for a Zope-based web |
---|
472 | application, it will probably make sense to share the eggs between the |
---|
473 | different sandboxes. You can tell <tt class="docutils literal">zc.buildout</tt> to use a central |
---|
474 | eggs directory by creating <tt class="docutils literal"><span class="pre">~/.buildout/default.cfg</span></tt> with the |
---|
475 | following contents:</p> |
---|
476 | <pre class="literal-block"> |
---|
477 | [buildout] |
---|
478 | eggs-directory = /home/bruno/buildout-eggs |
---|
479 | </pre> |
---|
480 | </div> |
---|
481 | <div class="section" id="start-the-instance"> |
---|
482 | <h2>Start the instance</h2> |
---|
483 | <p>You should be able now to start the created instance by doing:</p> |
---|
484 | <pre class="literal-block"> |
---|
485 | $ bin/zopectl fg |
---|
486 | </pre> |
---|
487 | <p>Alternatively you can do:</p> |
---|
488 | <blockquote> |
---|
489 | $ bin/paster serve parts/etc/deploy.ini</blockquote> |
---|
490 | <p>The port numbers where Kofa is running on your server are defined in |
---|
491 | buildout.cfg under [kofa_params].</p> |
---|
492 | <p>If you now point a browser to the right port on your server, for example</p> |
---|
493 | <pre class="literal-block"> |
---|
494 | localhost:8080 |
---|
495 | </pre> |
---|
496 | <p>you should get a login pop-up, where you can login as superuser with |
---|
497 | <tt class="docutils literal">grok</tt> and <tt class="docutils literal">grok</tt> as username/password (Kofa base package only!).</p> |
---|
498 | <p>You can stop the instance by pressing <CTRL-C>.</p> |
---|
499 | <p>If you are connected and logged in, |
---|
500 | you should be able to add the grok-based applications |
---|
501 | (such as <tt class="docutils literal">University</tt>) from the menu.</p> |
---|
502 | <p>Add an instance of <tt class="docutils literal">University</tt> and click on the link next to the |
---|
503 | then visible entry in the list of installed applications.</p> |
---|
504 | </div> |
---|
505 | <div class="section" id="running-the-tests"> |
---|
506 | <h2>Running the tests</h2> |
---|
507 | <p>The tests are easily run by executing the test runner that's |
---|
508 | installed in the <tt class="docutils literal">bin</tt> directory:</p> |
---|
509 | <pre class="literal-block"> |
---|
510 | $ bin/test |
---|
511 | </pre> |
---|
512 | </div> |
---|
513 | </div> |
---|
514 | <div class="section" id="part-2-deploying-kofa-as-zeo-install"> |
---|
515 | <h1>Part 2: Deploying Kofa as ZEO install</h1> |
---|
516 | <p>Each ZEO install consists of at least one ZEO server and normally two |
---|
517 | or more ZEO clients. While the ZEO server is meant to manage the ZODB |
---|
518 | database for clients, the clients connect to the outside world, listen |
---|
519 | for request and do the real dataprocessing.</p> |
---|
520 | <p>We prepared a <cite>buildout</cite> configuration that sets up one server |
---|
521 | configuration and two client configs. This configuration is in |
---|
522 | <tt class="docutils literal"><span class="pre">buildout-zeo.cfg</span></tt>.</p> |
---|
523 | <div class="section" id="generating-the-zeo-setup"> |
---|
524 | <h2>Generating the ZEO setup</h2> |
---|
525 | <p>To install Kofa ZEO-based you can run <cite>buildout</cite> with the given |
---|
526 | (or your own) configuration file like this:</p> |
---|
527 | <pre class="literal-block"> |
---|
528 | $ ./bin/buildout -c buildout-zeo.cfg |
---|
529 | </pre> |
---|
530 | <p>This should generate all scripts necessary to run servers, clients, |
---|
531 | etc.</p> |
---|
532 | </div> |
---|
533 | <div class="section" id="starting-zeo-servers-and-clients"> |
---|
534 | <h2>Starting ZEO servers and clients</h2> |
---|
535 | <p>First start the server:</p> |
---|
536 | <pre class="literal-block"> |
---|
537 | $ ./bin/zeo_server start |
---|
538 | </pre> |
---|
539 | <p>Clients can be started by doing:</p> |
---|
540 | <pre class="literal-block"> |
---|
541 | $ ./bin/zeo_client1 start |
---|
542 | $ ./bin/zeo_client2 start |
---|
543 | </pre> |
---|
544 | <p>This will start both clients in daemon mode.</p> |
---|
545 | <p>Instead of <tt class="docutils literal">start</tt> you can, as usually, start an instance in |
---|
546 | foreground (<tt class="docutils literal">fg</tt>), etc. You know the drill.</p> |
---|
547 | </div> |
---|
548 | <div class="section" id="manually-starting-zeo-clients"> |
---|
549 | <h2>Manually starting ZEO clients</h2> |
---|
550 | <p>This is normally not neccessary.</p> |
---|
551 | <p><tt class="docutils literal">zeo_clientN</tt> scripts are basically wrappers around calls to |
---|
552 | <tt class="docutils literal">bin/paster</tt>. You can bypass this wrapper and start a client |
---|
553 | 'manually' like this:</p> |
---|
554 | <pre class="literal-block"> |
---|
555 | $ ./bin/paster serve --pid-file var/zeo1.pid --daemon \ |
---|
556 | pars/etc/zeo1.ini |
---|
557 | </pre> |
---|
558 | <p>It is important to give a pid-file as paster otherwise can not start |
---|
559 | different clients (they would all refer to the same pid file |
---|
560 | <cite>paster.pid</cite> and refuse to start after the first client was started).</p> |
---|
561 | </div> |
---|
562 | <div class="section" id="setup-paramters-ports-etc"> |
---|
563 | <h2>Setup (paramters, ports, etc.)</h2> |
---|
564 | <p>By default the server will listen on port 8100 for requests from |
---|
565 | localhost (not: from the outside world).</p> |
---|
566 | <p>You can change ZEO server settings in the <tt class="docutils literal">[zeo_server]</tt> section |
---|
567 | of <tt class="docutils literal"><span class="pre">buildout-zeo.conf</span></tt>. Run <cite>buildout</cite> afterwards.</p> |
---|
568 | <p>The clients will listen on port 8081 and 8082. You can change settings |
---|
569 | in <tt class="docutils literal">etc/zeo1.ini.in</tt> and <tt class="docutils literal">etc/zeo2.ini.in</tt> respectively. Run |
---|
570 | buildout after any change.</p> |
---|
571 | <p>If you want to change the paster wrapper for any zeo client, you can |
---|
572 | edit <tt class="docutils literal">etc/zeo1.conf</tt> and/or <tt class="docutils literal">etc/zeo2.conf</tt>. Run buildout |
---|
573 | afterwards.</p> |
---|
574 | </div> |
---|
575 | <div class="section" id="creating-new-clients"> |
---|
576 | <h2>Creating new clients</h2> |
---|
577 | <p>You want more clients to be created by buildout? Easy. Three steps are |
---|
578 | neccessary.</p> |
---|
579 | <div class="section" id="create-config-files-in-etc"> |
---|
580 | <h3>1. Create config files in etc/</h3> |
---|
581 | <p>Each client needs two configuration files:</p> |
---|
582 | <blockquote> |
---|
583 | <ul> |
---|
584 | <li><dl class="first docutils"> |
---|
585 | <dt><tt class="docutils literal">etc/zeoN.conf</tt></dt> |
---|
586 | <dd><p class="first last">configuring the paster wrapper</p> |
---|
587 | </dd> |
---|
588 | </dl> |
---|
589 | </li> |
---|
590 | <li><dl class="first docutils"> |
---|
591 | <dt><tt class="docutils literal">etc/zeoN.ini</tt></dt> |
---|
592 | <dd><p class="first last">configuring the runtime config, ports, etc.</p> |
---|
593 | </dd> |
---|
594 | </dl> |
---|
595 | </li> |
---|
596 | </ul> |
---|
597 | </blockquote> |
---|
598 | <p>Just copy over these files from the already existing zeo1/zeo2 files |
---|
599 | and replace <tt class="docutils literal">zeo1</tt> or <tt class="docutils literal">zeo2</tt> with your new name.</p> |
---|
600 | </div> |
---|
601 | <div class="section" id="update-buildout-zeo-cfg"> |
---|
602 | <h3>2. Update buildout-zeo.cfg</h3> |
---|
603 | <p>Here, inside <tt class="docutils literal"><span class="pre">buildourt-zeo.cfg</span></tt> also three steps are needed.</p> |
---|
604 | <ul> |
---|
605 | <li><p class="first">2.1. Create new .ini and .conf entries</p> |
---|
606 | <p>The .conf and .ini files in etc/ are only templates that have to be |
---|
607 | generated in their really used final location. In buildout-zeo.cfg |
---|
608 | you can care for this by creating a new <tt class="docutils literal">[zeoN_ini]</tt> and |
---|
609 | <tt class="docutils literal">[zeoN_conf]</tt> option (replacing <tt class="docutils literal">N</tt> with a number, of course).</p> |
---|
610 | <p>Just copy over existing entries and replace the mentions of <tt class="docutils literal">zeo1</tt> |
---|
611 | or <tt class="docutils literal">zeo2</tt> by your <tt class="docutils literal">zeoN</tt>.</p> |
---|
612 | </li> |
---|
613 | <li><p class="first">2.2. Create a new <tt class="docutils literal">zeo_clientN</tt> entry</p> |
---|
614 | <p>Then you have to create an entry that will generate the |
---|
615 | <tt class="docutils literal">zeo_clientN</tt> script. Again, just copy over an existing |
---|
616 | <tt class="docutils literal">[zeo_client1]</tt> entry and replace <tt class="docutils literal">1</tt> withg your client number.</p> |
---|
617 | </li> |
---|
618 | <li><p class="first">2.3. Register the new sections in <tt class="docutils literal">[buildout]</tt> section</p> |
---|
619 | <p>When done with the above: add the new section in <tt class="docutils literal">[buildout]</tt>:</p> |
---|
620 | <pre class="literal-block"> |
---|
621 | [buildout] |
---|
622 | ... |
---|
623 | <old entries...> |
---|
624 | ... |
---|
625 | zope_conf_zeo_5 |
---|
626 | zeo5_ini |
---|
627 | zeo_client5 |
---|
628 | </pre> |
---|
629 | <p>depending on how you named your new sections.</p> |
---|
630 | </li> |
---|
631 | </ul> |
---|
632 | </div> |
---|
633 | <div class="section" id="rerun-buildout"> |
---|
634 | <h3>3. Rerun <tt class="docutils literal">buildout</tt></h3> |
---|
635 | <p>When adding or removing client/server instances, make sure to stop all |
---|
636 | running servers/clients before rerunning buildout.</p> |
---|
637 | <p>To activate the new setup, rerun buildout:</p> |
---|
638 | <pre class="literal-block"> |
---|
639 | $ bin/buildout -c buildout-zeo.cfg |
---|
640 | </pre> |
---|
641 | <p>This should generate any new clients and remove older ones or just |
---|
642 | update configuration files.</p> |
---|
643 | </div> |
---|
644 | </div> |
---|
645 | <div class="section" id="considerations"> |
---|
646 | <h2>Considerations</h2> |
---|
647 | <p>There are some things in the current buildout-zeo.cfg we might do not |
---|
648 | want. It extends the regular <tt class="docutils literal">buildout.cfg</tt> so that we do not have |
---|
649 | to repeat most sections but the <tt class="docutils literal">parts</tt> in <tt class="docutils literal">[buildout]</tt> have to be |
---|
650 | listed.</p> |
---|
651 | <p>We need, however, not everything with a ZEO-deploy that is listed in a |
---|
652 | default buildout. We might do not need docs, no profiling, etc. Also a |
---|
653 | regular non-ZEO kofactl might not make to much sense. Therefore all |
---|
654 | this might be subject to changes.</p> |
---|
655 | </div> |
---|
656 | </div> |
---|
657 | </div> |
---|
658 | </body> |
---|
659 | </html> |
---|