src/build/html/zeo.html
changeset 0 d153941bb745
equal deleted inserted replaced
-1:000000000000 0:d153941bb745
       
     1 
       
     2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
       
     3   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
       
     4 
       
     5 <html xmlns="http://www.w3.org/1999/xhtml">
       
     6   <head>
       
     7     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
       
     8     <title>Creating a ZEO server &#8212; PyAMS User Guide 0.1.0 documentation</title>
       
     9     <link rel="stylesheet" href="_static/pyramid.css" type="text/css" />
       
    10     <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
       
    11     <script type="text/javascript">
       
    12       var DOCUMENTATION_OPTIONS = {
       
    13         URL_ROOT:    './',
       
    14         VERSION:     '0.1.0',
       
    15         COLLAPSE_INDEX: false,
       
    16         FILE_SUFFIX: '.html',
       
    17         HAS_SOURCE:  true,
       
    18         SOURCELINK_SUFFIX: '.txt'
       
    19       };
       
    20     </script>
       
    21     <script type="text/javascript" src="_static/jquery.js"></script>
       
    22     <script type="text/javascript" src="_static/underscore.js"></script>
       
    23     <script type="text/javascript" src="_static/doctools.js"></script>
       
    24     <link rel="index" title="Index" href="genindex.html" />
       
    25     <link rel="search" title="Search" href="search.html" />
       
    26     <link rel="next" title="Installing PyAMS" href="install.html" />
       
    27     <link rel="prev" title="Welcome to PyAMS_utils’s documentation!" href="index.html" />
       
    28 <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Neuton&amp;subset=latin" type="text/css" media="screen" charset="utf-8" />
       
    29 <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Nobile:regular,italic,bold,bolditalic&amp;subset=latin" type="text/css" media="screen" charset="utf-8" />
       
    30 <!--[if lte IE 6]>
       
    31 <link rel="stylesheet" href="_static/ie6.css" type="text/css" media="screen" charset="utf-8" />
       
    32 <![endif]-->
       
    33 
       
    34   </head>
       
    35   <body>
       
    36 
       
    37     <div class="related" role="navigation" aria-label="related navigation">
       
    38       <h3>Navigation</h3>
       
    39       <ul>
       
    40         <li class="right" style="margin-right: 10px">
       
    41           <a href="genindex.html" title="General Index"
       
    42              accesskey="I">index</a></li>
       
    43         <li class="right" >
       
    44           <a href="install.html" title="Installing PyAMS"
       
    45              accesskey="N">next</a> |</li>
       
    46         <li class="right" >
       
    47           <a href="index.html" title="Welcome to PyAMS_utils’s documentation!"
       
    48              accesskey="P">previous</a> |</li>
       
    49         <li class="nav-item nav-item-0"><a href="index.html">PyAMS User Guide 0.1.0 documentation</a> &#187;</li> 
       
    50       </ul>
       
    51     </div>  
       
    52 
       
    53     <div class="document">
       
    54       <div class="documentwrapper">
       
    55         <div class="bodywrapper">
       
    56           <div class="body" role="main">
       
    57             
       
    58   <div class="section" id="creating-a-zeo-server">
       
    59 <span id="zeo"></span><h1>Creating a ZEO server<a class="headerlink" href="#creating-a-zeo-server" title="Permalink to this headline">¶</a></h1>
       
    60 <p>PyAMS primarily relies on a ZODB database to store it’s configuration. Other packages may rely on another
       
    61 database, but <em>PyAMS_content</em> package also stores it’s contents in a ZODB.</p>
       
    62 <p>As some PyAMS packages start concurrent processes (“synchronization” is done via <strong>ØMQ</strong>), concurrent accesses are
       
    63 required on the ZODB (even when you start your application in “single process” mode) and a ZEO server have to be
       
    64 started.</p>
       
    65 <div class="section" id="creating-initial-buildout">
       
    66 <h2>Creating initial buildout<a class="headerlink" href="#creating-initial-buildout" title="Permalink to this headline">¶</a></h2>
       
    67 <p>PyAMS provides a ZEO server scaffold, called <em>zeo_server</em>, generated via a <em>cookiecutter</em> template.</p>
       
    68 <p>A simple option to create a ZEO server is to create a buildout environment including <em>ZEO</em> and <em>ZODB</em> packages:</p>
       
    69 <div class="highlight-bash"><div class="highlight"><pre><span></span><span class="c1"># mkdir /var/local/</span>
       
    70 <span class="c1"># pip3 install virtualenv</span>
       
    71 <span class="c1"># virtualenv --python=python3.5 env</span>
       
    72 <span class="c1"># cd env</span>
       
    73 <span class="c1"># . bin/activate</span>
       
    74 <span class="o">(</span>env<span class="o">)</span> <span class="c1"># pip3.5 install cookiecutter</span>
       
    75 <span class="o">(</span>env<span class="o">)</span> <span class="c1"># cookiecutter hg+http://hg.ztfy.org/pyams/scaffolds/zeo_server</span>
       
    76 </pre></div>
       
    77 </div>
       
    78 <p><em>CookieCutter</em> will ask you for a small set of input variables that you can change or not:</p>
       
    79 <ul class="simple">
       
    80 <li><strong>pyams_release</strong>: version of PyAMS configuration file to use. “latest” (default value) will point to last release;
       
    81 you can also choose to point to a given release (“0.1.4” for example)</li>
       
    82 <li><strong>project_name</strong>: current environment name in “human form”</li>
       
    83 <li><strong>project_slug</strong>: “technical” package name, based on project name</li>
       
    84 <li><strong>eggs_directory</strong>: relative or absolute path to directory containing downloaded eggs; this directory can be
       
    85 shared with other projects (“eggs” as default)</li>
       
    86 <li><strong>run_user</strong>: user name under which ZEO process will run (“zeoadm” as default)</li>
       
    87 <li><strong>run_group</strong>: group name under which ZEO process will run (“zeo” as default)</li>
       
    88 <li><strong>zeo_server_port</strong>: listening port of ZEO server (“8100” as default)</li>
       
    89 <li><strong>zeo_monitor_port</strong>: listening port of ZEO monitor (“8101” as default)</li>
       
    90 <li><strong>zeo_storage</strong>: name of first ZEO storage; default value is based on project name</li>
       
    91 <li><strong>use_zeo_auth</strong>: specify if ZEO authentication should be used</li>
       
    92 <li><strong>zeo_auth_user</strong>: name of ZEO authenticated user (if ZEO authentication is used)</li>
       
    93 <li><strong>zeo_auth_password</strong>: password of ZEO authenticated user (if ZEO authentication is used)</li>
       
    94 <li><strong>zeo_pack_report</strong>: email address to which pack reports should be sent</li>
       
    95 <li><strong>logs_directory</strong>: absolute path to directory containing ZEO’s log files.</li>
       
    96 </ul>
       
    97 <p>A message is displayed after initialization to finalize environment creation:</p>
       
    98 </div>
       
    99 <div class="section" id="zeo-server-configuration">
       
   100 <h2>ZEO server configuration<a class="headerlink" href="#zeo-server-configuration" title="Permalink to this headline">¶</a></h2>
       
   101 <p>All ZEO configuration files are generated in “etc” subdirectory. These includes:</p>
       
   102 <ul class="simple">
       
   103 <li><strong>etc/zeo_server-zdaemon.conf</strong>: ZDaemon configuration file</li>
       
   104 <li><strong>etc/zeo_server-zeo.conf</strong>: ZEO server configuration file</li>
       
   105 <li><strong>etc/auth.db</strong>: ZEO authentication file; WARNING: this file is not created automatically, you have to create it
       
   106 after buildout.</li>
       
   107 </ul>
       
   108 <p>In these file names, always replace “zeo_server” with the value which was given to “project_slug” variable during
       
   109 <em>CookieCutter</em> template creation.</p>
       
   110 </div>
       
   111 <div class="section" id="zeo-server-tools">
       
   112 <h2>ZEO server tools<a class="headerlink" href="#zeo-server-tools" title="Permalink to this headline">¶</a></h2>
       
   113 <p>A set of system configuration files are produced to handle your ZEO environment. These includes:</p>
       
   114 <ul>
       
   115 <li><p class="first"><strong>etc/init.d/zeo-zeo_server</strong>: ZEO server start/stop script in Init-D format. Create a link to this file in
       
   116 <em>/etc/init.d</em> and update Init.d scripts (<em>update-rc.d zeo-zeo_server defaults</em>) to include ZEO in server start/stop</p>
       
   117 <blockquote>
       
   118 <div><p>process. You can also use this script to start/stop ZEO by hand with <em>start</em> and <em>stop</em> arguments.</p>
       
   119 </div></blockquote>
       
   120 </li>
       
   121 <li><p class="first"><strong>etc/systemd/zeo-zeo_server.service</strong>: SystemD service configuration file for ZEO server. Create a link to this
       
   122 file in <em>/etc/systemd/system</em> and reload SystemD daemon (<em>systemctl daemon-reload</em>) before activating ZEO service
       
   123 (<em>systemctl enable zeo-zeo_server.service</em> and <em>systemctl start zeo-zeo_server.service</em>).</p>
       
   124 </li>
       
   125 <li><p class="first"><strong>etc/logrotate.d/zeo-zeo_server</strong>: LogRotate configuration file for ZEO log files. Create a link to this file in
       
   126 <em>/etc/logrotate.d</em> to activate log rotation for ZEO server.</p>
       
   127 </li>
       
   128 <li><p class="first"><strong>etc/cron.d/pack-zeo-zeo_server</strong>: Cron configuration file for ZEO database packing. Just create a link to this
       
   129 file in <em>/etc/cron.d</em> directory to enable ZODB packing on a weekly basis (by default).</p>
       
   130 </li>
       
   131 </ul>
       
   132 <p>In these file names, always replace “zeo_server” with the value which was given to “project_slug” variable during
       
   133 <em>CookieCutter</em> template creation. All directory names are those used on a Debian GNU/Linux distribution and may have
       
   134 to be changed on other distributions.</p>
       
   135 </div>
       
   136 </div>
       
   137 
       
   138 
       
   139           </div>
       
   140         </div>
       
   141       </div>
       
   142       <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
       
   143         <div class="sphinxsidebarwrapper">
       
   144   <h3><a href="index.html">Table Of Contents</a></h3>
       
   145   <ul>
       
   146 <li><a class="reference internal" href="#">Creating a ZEO server</a><ul>
       
   147 <li><a class="reference internal" href="#creating-initial-buildout">Creating initial buildout</a></li>
       
   148 <li><a class="reference internal" href="#zeo-server-configuration">ZEO server configuration</a></li>
       
   149 <li><a class="reference internal" href="#zeo-server-tools">ZEO server tools</a></li>
       
   150 </ul>
       
   151 </li>
       
   152 </ul>
       
   153 
       
   154   <h4>Previous topic</h4>
       
   155   <p class="topless"><a href="index.html"
       
   156                         title="previous chapter">Welcome to PyAMS_utils’s documentation!</a></p>
       
   157   <h4>Next topic</h4>
       
   158   <p class="topless"><a href="install.html"
       
   159                         title="next chapter">Installing PyAMS</a></p>
       
   160 <div id="searchbox" style="display: none" role="search">
       
   161   <h3>Quick search</h3>
       
   162     <form class="search" action="search.html" method="get">
       
   163       <div><input type="text" name="q" /></div>
       
   164       <div><input type="submit" value="Go" /></div>
       
   165       <input type="hidden" name="check_keywords" value="yes" />
       
   166       <input type="hidden" name="area" value="default" />
       
   167     </form>
       
   168 </div>
       
   169 <script type="text/javascript">$('#searchbox').show(0);</script>
       
   170         </div>
       
   171       </div>
       
   172       <div class="clearer"></div>
       
   173     </div>
       
   174     <div class="related" role="navigation" aria-label="related navigation">
       
   175       <h3>Navigation</h3>
       
   176       <ul>
       
   177         <li class="right" style="margin-right: 10px">
       
   178           <a href="genindex.html" title="General Index"
       
   179              >index</a></li>
       
   180         <li class="right" >
       
   181           <a href="install.html" title="Installing PyAMS"
       
   182              >next</a> |</li>
       
   183         <li class="right" >
       
   184           <a href="index.html" title="Welcome to PyAMS_utils’s documentation!"
       
   185              >previous</a> |</li>
       
   186         <li class="nav-item nav-item-0"><a href="index.html">PyAMS User Guide 0.1.0 documentation</a> &#187;</li> 
       
   187       </ul>
       
   188     </div>
       
   189     <div class="footer" role="contentinfo">
       
   190         &#169; Copyright 2017, Thierry Florac.
       
   191       Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.6.5.
       
   192     </div>
       
   193   </body>
       
   194 </html>