www.nico.schottelius.org/software/cdist/man/4.6.0/cdist-parallelization.html

324 lines
12 KiB
HTML
Raw Normal View History

2017-08-25 09:06:15 +00:00
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>16. Parallelization &mdash; cdist 4.6.0 documentation</title>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="index" title="Index"
href="genindex.html"/>
<link rel="search" title="Search" href="search.html"/>
<link rel="top" title="cdist 4.6.0 documentation" href="index.html"/>
<link rel="next" title="17. Inventory" href="cdist-inventory.html"/>
<link rel="prev" title="15. Messaging" href="cdist-messaging.html"/>
<script src="_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search">
<a href="index.html" class="icon icon-home"> cdist
</a>
<div class="version">
4.6.0
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="cdist-intro.html">1. cdist - usable configuration management</a></li>
<li class="toctree-l1"><a class="reference internal" href="cdist-why.html">2. Why should I use cdist?</a></li>
<li class="toctree-l1"><a class="reference internal" href="cdist-os.html">3. Supported Operating Systems</a></li>
<li class="toctree-l1"><a class="reference internal" href="cdist-install.html">4. How to install cdist</a></li>
<li class="toctree-l1"><a class="reference internal" href="cdist-update.html">5. How to update cdist</a></li>
<li class="toctree-l1"><a class="reference internal" href="cdist-support.html">6. Support</a></li>
<li class="toctree-l1"><a class="reference internal" href="cdist-features.html">7. Features</a></li>
<li class="toctree-l1"><a class="reference internal" href="cdist-quickstart.html">8. Quickstart</a></li>
<li class="toctree-l1"><a class="reference internal" href="man1/cdist.html">9. cdist(1)</a></li>
<li class="toctree-l1"><a class="reference internal" href="cdist-bootstrap.html">10. Bootstrap</a></li>
<li class="toctree-l1"><a class="reference internal" href="cdist-manifest.html">11. Manifest</a></li>
<li class="toctree-l1"><a class="reference internal" href="cdist-type.html">12. cdist type</a></li>
<li class="toctree-l1"><a class="reference internal" href="cdist-types.html">13. cdist types</a></li>
<li class="toctree-l1"><a class="reference internal" href="cdist-explorer.html">14. Explorer</a></li>
<li class="toctree-l1"><a class="reference internal" href="cdist-messaging.html">15. Messaging</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">16. Parallelization</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#description">16.1. Description</a></li>
<li class="toctree-l2"><a class="reference internal" href="#examples">16.2. Examples</a></li>
<li class="toctree-l2"><a class="reference internal" href="#caveats">16.3. Caveats</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="cdist-inventory.html">17. Inventory</a></li>
<li class="toctree-l1"><a class="reference internal" href="cdist-reference.html">18. Reference</a></li>
<li class="toctree-l1"><a class="reference internal" href="cdist-best-practice.html">19. Best practice</a></li>
<li class="toctree-l1"><a class="reference internal" href="cdist-stages.html">20. Execution stages</a></li>
<li class="toctree-l1"><a class="reference internal" href="cdist-remote-exec-copy.html">21. Remote exec and copy commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="cdist-hacker.html">22. Hacking</a></li>
<li class="toctree-l1"><a class="reference internal" href="cdist-troubleshooting.html">23. Troubleshooting</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">cdist</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html">Docs</a> &raquo;</li>
<li>16. Parallelization</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/cdist-parallelization.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="parallelization">
<h1>16. Parallelization<a class="headerlink" href="#parallelization" title="Permalink to this headline"></a></h1>
<div class="section" id="description">
<h2>16.1. Description<a class="headerlink" href="#description" title="Permalink to this headline"></a></h2>
<p>cdist has two modes of parallel operation.</p>
<p>One of them is to operate on each host in separate process. This is enabled
with <strong>-p/--parallel</strong> option.</p>
<p>The other way is to operate in parallel within one host where you specify
the number of jobs. This is enabled with <strong>-j/--jobs</strong> option where you
can specify the number of parallel jobs. By default,
<strong>multiprocessing.cpu_count()</strong> is used. For this mode global explorers,
object preparation and object run are supported and this option is still in
<strong>beta</strong>.</p>
<p>You can, of course, use those two options together. This means that each host
will be processed by its own process. Within each process cdist will operate
using specified number of parallel jobs.</p>
<p>For more info on those options see <strong>cdist</strong>(1).</p>
</div>
<div class="section" id="examples">
<h2>16.2. Examples<a class="headerlink" href="#examples" title="Permalink to this headline"></a></h2>
<div class="highlight-sh"><div class="highlight"><pre><span></span><span class="c1"># Configure hosts read from file hosts.file in parallel</span>
$ cdist config -p -f hosts.file
<span class="c1"># Configure hosts read from file hosts.file sequentially but using default</span>
<span class="c1"># number of parallel jobs</span>
$ cdist config -b -j -f hosts.file
<span class="c1"># Configure hosts read from file hosts.file in parallel using 16</span>
<span class="c1"># parallel jobs</span>
$ cdist config -b -j <span class="m">16</span> -p -f hosts.file
</pre></div>
</div>
</div>
<div class="section" id="caveats">
<h2>16.3. Caveats<a class="headerlink" href="#caveats" title="Permalink to this headline"></a></h2>
<p>When operating in parallel, either by operating in parallel for each host
(-p/--parallel) or by parallel jobs within a host (-j/--jobs), and depending
on target SSH server and its configuration you may encounter connection drops.
This is controlled with sshd :strong:MaxStartups configuration options.
You may also encounter session open refusal. This happens with ssh multiplexing
when you reach maximum number of open sessions permitted per network
connection. In this case ssh will disable multiplexing.
This limit is controlled with sshd :strong:MaxSessions configuration
options. For more details refer to <strong>sshd_config</strong>(5).</p>
<p>For example, if you reach <strong>MaxSessions</strong> sessions you may get the
following output:</p>
<div class="highlight-sh"><div class="highlight"><pre><span></span>$ cdist config -b -j <span class="m">11</span> -v <span class="m">78</span>.47.116.244
INFO: cdist: version <span class="m">4</span>.2.2-55-g640b7f9
INFO: <span class="m">78</span>.47.116.244: Running global explorers
INFO: <span class="m">78</span>.47.116.244: Remote transfer in <span class="m">11</span> parallel <span class="nb">jobs</span>
channel <span class="m">22</span>: open failed: administratively prohibited: open failed
mux_client_request_session: session request failed: Session open refused by peer
ControlSocket /tmp/tmpuah6fw_t/d886d4b7e4425a102a54bfaff4d2288b/ssh-control-path already exists, disabling multiplexing
INFO: <span class="m">78</span>.47.116.244: Running global explorers in <span class="m">11</span> parallel <span class="nb">jobs</span>
channel <span class="m">22</span>: open failed: administratively prohibited: open failed
mux_client_request_session: session request failed: Session open refused by peer
ControlSocket /tmp/tmpuah6fw_t/d886d4b7e4425a102a54bfaff4d2288b/ssh-control-path already exists, disabling multiplexing
INFO: <span class="m">78</span>.47.116.244: Running initial manifest /tmp/tmpuah6fw_t/d886d4b7e4425a102a54bfaff4d2288b/data/conf/manifest/init
INFO: <span class="m">78</span>.47.116.244: Running manifest and explorers <span class="k">for</span> __file/root/host.file
INFO: <span class="m">78</span>.47.116.244: Generating code <span class="k">for</span> __file/root/host.file
INFO: <span class="m">78</span>.47.116.244: Finished successful run in <span class="m">18</span>.655028820037842 seconds
INFO: cdist: Total processing <span class="nb">time</span> <span class="k">for</span> <span class="m">1</span> host<span class="o">(</span>s<span class="o">)</span>: <span class="m">19</span>.159148693084717
</pre></div>
</div>
</div>
</div>
</div>
<div class="articleComments">
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="cdist-inventory.html" class="btn btn-neutral float-right" title="17. Inventory" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="cdist-messaging.html" class="btn btn-neutral" title="15. Messaging" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright .
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'4.6.0',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>