/usr/share/doc/python-oslo.messaging/html/zmq_driver.html is in python-oslo.messaging 5.10.0-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ZeroMQ Driver Deployment Guide — oslo.messaging documentation</title>
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/tweaks.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</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>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="top" title="oslo.messaging documentation" href="index.html" />
<link rel="next" title="Frequently Asked Questions" href="FAQ.html" />
<link rel="prev" title="AMQP 1.0 Protocol Driver Deployment Guide" href="AMQP1.0.html" />
</head>
<body role="document">
<div id="header">
<h1 id="logo"><a href="http://www.openstack.org/">OpenStack</a></h1>
<ul id="navigation">
<li><a href="http://www.openstack.org/" title="Go to the Home page" class="link">Home</a></li>
<li><a href="http://www.openstack.org/projects/" title="Go to the OpenStack Projects page">Projects</a></li>
<li><a href="http://www.openstack.org/user-stories/" title="Go to the User Stories page" class="link">User Stories</a></li>
<li><a href="http://www.openstack.org/community/" title="Go to the Community page" class="link">Community</a></li>
<li><a href="http://www.openstack.org/blog/" title="Go to the OpenStack Blog">Blog</a></li>
<li><a href="http://wiki.openstack.org/" title="Go to the OpenStack Wiki">Wiki</a></li>
<li><a href="http://docs.openstack.org/" title="Go to OpenStack Documentation" class="current">Documentation</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="zeromq-driver-deployment-guide">
<h1>ZeroMQ Driver Deployment Guide<a class="headerlink" href="#zeromq-driver-deployment-guide" title="Permalink to this headline">¶</a></h1>
<div class="section" id="introduction">
<h2>Introduction<a class="headerlink" href="#introduction" title="Permalink to this headline">¶</a></h2>
<p>0MQ (also known as ZeroMQ or zmq) is embeddable networking library
but acts like a concurrency framework. It gives you sockets
that carry atomic messages across various transports
like in-process, inter-process, TCP, and multicast. You can connect
sockets N-to-N with patterns like fan-out, pub-sub, task distribution,
and request-reply. It’s fast enough to be the fabric for clustered
products. Its asynchronous I/O model gives you scalable multi-core
applications, built as asynchronous message-processing tasks. It has
a score of language APIs and runs on most operating systems.</p>
<p>Originally the zero in 0MQ was meant as “zero broker” and (as close to)
“zero latency” (as possible). Since then, it has come to encompass
different goals: zero administration, zero cost, and zero waste.
More generally, “zero” refers to the culture of minimalism that permeates
the project.</p>
<p>More detail regarding ZeroMQ library is available from the <a class="reference external" href="http://zguide.zeromq.org/page:all">specification</a>.</p>
</div>
<div class="section" id="abstract">
<h2>Abstract<a class="headerlink" href="#abstract" title="Permalink to this headline">¶</a></h2>
<p>Currently, ZeroMQ is one of the RPC backend drivers in oslo.messaging. ZeroMQ
can be the only RPC driver across the OpenStack cluster.
This document provides deployment information for this driver in oslo_messaging.</p>
<p>Other than AMQP-based drivers, like RabbitMQ, ZeroMQ doesn’t have
any central brokers in oslo.messaging, instead, each host (running OpenStack
services) is both ZeroMQ client and server. As a result, each host needs to
listen to a certain TCP port for incoming connections and directly connect
to other hosts simultaneously.</p>
<p>Another option is to use a router proxy. It is not a broker because it
doesn’t assume any message ownership or persistence or replication etc. It
performs only a redirection of messages to endpoints taking routing info from
message envelope.</p>
<p>Topics are used to identify the destination for a ZeroMQ RPC call. There are
two types of topics, bare topics and directed topics. Bare topics look like
‘compute’, while directed topics look like ‘compute.machine1’.</p>
</div>
<div class="section" id="scenario">
<h2>Scenario<a class="headerlink" href="#scenario" title="Permalink to this headline">¶</a></h2>
<p>Assuming the following systems as a goal.</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="o">+--------+</span>
<span class="o">|</span> <span class="n">Client</span> <span class="o">|</span>
<span class="o">+----+---+</span>
<span class="o">|</span>
<span class="o">-----+---------+-----------------------+---------------------</span>
<span class="o">|</span> <span class="o">|</span>
<span class="o">+--------+------------+</span> <span class="o">+-------+----------------+</span>
<span class="o">|</span> <span class="n">Controller</span> <span class="n">Node</span> <span class="o">|</span> <span class="o">|</span> <span class="n">Compute</span> <span class="n">Node</span> <span class="o">|</span>
<span class="o">|</span> <span class="n">Nova</span> <span class="o">|</span> <span class="o">|</span> <span class="n">Neutron</span> <span class="o">|</span>
<span class="o">|</span> <span class="n">Keystone</span> <span class="o">|</span> <span class="o">|</span> <span class="n">Nova</span> <span class="o">|</span>
<span class="o">|</span> <span class="n">Glance</span> <span class="o">|</span> <span class="o">|</span> <span class="n">nova</span><span class="o">-</span><span class="n">compute</span> <span class="o">|</span>
<span class="o">|</span> <span class="n">Neutron</span> <span class="o">|</span> <span class="o">|</span> <span class="n">Ceilometer</span> <span class="o">|</span>
<span class="o">|</span> <span class="n">Cinder</span> <span class="o">|</span> <span class="o">|</span> <span class="o">|</span>
<span class="o">|</span> <span class="n">Ceilometer</span> <span class="o">|</span> <span class="o">+------------------------+</span>
<span class="o">|</span> <span class="n">zmq</span><span class="o">-</span><span class="n">proxy</span> <span class="o">|</span>
<span class="o">|</span> <span class="n">Redis</span> <span class="o">|</span>
<span class="o">|</span> <span class="n">Horizon</span> <span class="o">|</span>
<span class="o">+---------------------+</span>
</pre></div>
</div>
</div>
<div class="section" id="configuration">
<h2>Configuration<a class="headerlink" href="#configuration" title="Permalink to this headline">¶</a></h2>
<div class="section" id="enabling-mandatory">
<h3>Enabling (mandatory)<a class="headerlink" href="#enabling-mandatory" title="Permalink to this headline">¶</a></h3>
<p>To enable the driver the ‘transport_url’ option must be set to ‘zmq://’
in the section [DEFAULT] of the conf file, the ‘rpc_zmq_host’ flag
must be set to the hostname of the current node.</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="p">[</span><span class="n">DEFAULT</span><span class="p">]</span>
<span class="n">transport_url</span> <span class="o">=</span> <span class="s2">"zmq://"</span>
<span class="p">[</span><span class="n">oslo_messaging_zmq</span><span class="p">]</span>
<span class="n">rpc_zmq_host</span> <span class="o">=</span> <span class="p">{</span><span class="n">hostname</span><span class="p">}</span>
</pre></div>
</div>
</div>
<div class="section" id="match-making-mandatory">
<h3>Match Making (mandatory)<a class="headerlink" href="#match-making-mandatory" title="Permalink to this headline">¶</a></h3>
<p>The ZeroMQ driver implements a matching capability to discover hosts available
for communication when sending to a bare topic. This allows broker-less
communications.</p>
<p>The MatchMaker is pluggable and it provides two different MatchMaker classes.</p>
<p>DummyMatchMaker: default matchmaker driver for all-in-one scenario (messages
are sent to itself).</p>
<p>RedisMatchMaker: loads the hash table from a remote Redis server, supports
dynamic host/topic registrations, host expiration, and hooks for consuming
applications to acknowledge or neg-acknowledge topic.host service availability.</p>
<p>For ZeroMQ driver Redis is configured in transport_url also. For using Redis
specify the URL as follows:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="p">[</span><span class="n">DEFAULT</span><span class="p">]</span>
<span class="n">transport_url</span> <span class="o">=</span> <span class="s2">"zmq+redis://127.0.0.1:6379"</span>
</pre></div>
</div>
<p>In order to cleanup redis storage from expired records (e.g. target listener
goes down) TTL may be applied for keys. Configure ‘zmq_target_expire’ option
which is 120 (seconds) by default. The option is related not specifically to
redis so it is also defined in [oslo_messaging_zmq] section. If option value
is <= 0 then keys don’t expire and live forever in the storage.</p>
</div>
<div class="section" id="matchmaker-data-source-mandatory">
<h3>MatchMaker Data Source (mandatory)<a class="headerlink" href="#matchmaker-data-source-mandatory" title="Permalink to this headline">¶</a></h3>
<p>MatchMaker data source is stored in files or Redis server discussed in the
previous section. How to make up the database is the key issue for making ZeroMQ
driver work.</p>
<p>If deploying the RedisMatchMaker, a Redis server is required. Each (K, V) pair
stored in Redis is that the key is a base topic and the corresponding values are
hostname arrays to be sent to.</p>
</div>
<div class="section" id="ha-for-redis-database">
<h3>HA for Redis database<a class="headerlink" href="#ha-for-redis-database" title="Permalink to this headline">¶</a></h3>
<p>Single node Redis works fine for testing, but for production there is some
availability guarantees wanted. Without Redis database zmq deployment should
continue working anyway, because there is no need in Redis for services when
connections established already. But if you would like to restart some services
or run more workers or add more hardware nodes to the deployment you will need
nodes discovery mechanism to work and it requires Redis.</p>
<p>To provide database recovery in situations when redis node goes down for example,
we use Sentinel solution and redis master-slave-slave configuration (if we have
3 controllers and run Redis on each of them).</p>
<p>To deploy redis with HA follow the <a class="reference external" href="http://redis.io/topics/sentinel">sentinel-install</a> instructions. From the
messaging driver’s side you will need to setup following configuration</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="p">[</span><span class="n">DEFAULT</span><span class="p">]</span>
<span class="n">transport_url</span> <span class="o">=</span> <span class="s2">"zmq+redis://host1:26379,host2:26379,host3:26379"</span>
</pre></div>
</div>
</div>
<div class="section" id="restrict-the-number-of-tcp-sockets-on-controller">
<h3>Restrict the number of TCP sockets on controller<a class="headerlink" href="#restrict-the-number-of-tcp-sockets-on-controller" title="Permalink to this headline">¶</a></h3>
<p>The most heavily used RPC pattern (CALL) may consume too many TCP sockets on
controller node in directly connected configuration. To solve the issue
ROUTER proxy may be used.</p>
<p>In order to configure driver to use ROUTER proxy set up the ‘use_router_proxy’
option to true in [oslo_messaging_zmq] section (false is set by default).</p>
<p>For example:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">use_router_proxy</span> <span class="o">=</span> <span class="n">true</span>
</pre></div>
</div>
<p>Not less than 3 proxies should be running on controllers or on stand alone
nodes. The parameters for the script oslo-messaging-zmq-proxy should be:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">oslo</span><span class="o">-</span><span class="n">messaging</span><span class="o">-</span><span class="n">zmq</span><span class="o">-</span><span class="n">proxy</span>
<span class="o">--</span><span class="n">config</span><span class="o">-</span><span class="n">file</span> <span class="o">/</span><span class="n">etc</span><span class="o">/</span><span class="n">oslo</span><span class="o">/</span><span class="n">zeromq</span><span class="o">.</span><span class="n">conf</span>
<span class="o">--</span><span class="n">log</span><span class="o">-</span><span class="n">file</span> <span class="o">/</span><span class="n">var</span><span class="o">/</span><span class="n">log</span><span class="o">/</span><span class="n">oslo</span><span class="o">/</span><span class="n">zmq</span><span class="o">-</span><span class="n">router</span><span class="o">-</span><span class="n">proxy</span><span class="o">.</span><span class="n">log</span>
</pre></div>
</div>
<p>Fanout-based patterns like CAST+Fanout and notifications always use proxy
as they act over PUB/SUB, ‘use_pub_sub’ option defaults to true. In such case
publisher proxy should be running. Actually proxy does both: routing to a
DEALER endpoint for direct messages and publishing to all subscribers over
zmq.PUB socket.</p>
<p>If not using PUB/SUB (use_pub_sub = false) then fanout will be emulated over
direct DEALER/ROUTER unicast which is possible but less efficient and therefore
is not recommended. In a case of direct DEALER/ROUTER unicast proxy is not
needed.</p>
<p>This option can be set in [oslo_messaging_zmq] section.</p>
<p>For example:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">use_pub_sub</span> <span class="o">=</span> <span class="n">true</span>
</pre></div>
</div>
<p>In case of using a proxy all publishers (clients) talk to servers over
the proxy connecting to it via TCP.</p>
<p>You can specify ZeroMQ options in /etc/oslo/zeromq.conf if necessary.</p>
</div>
<div class="section" id="listening-address-optional">
<h3>Listening Address (optional)<a class="headerlink" href="#listening-address-optional" title="Permalink to this headline">¶</a></h3>
<p>All services bind to an IP address or Ethernet adapter. By default, all services
bind to ‘*’, effectively binding to 0.0.0.0. This may be changed with the option
‘rpc_zmq_bind_address’ which accepts a wildcard, IP address, or Ethernet adapter.</p>
<p>This configuration can be set in [oslo_messaging_zmq] section.</p>
<p>For example:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">rpc_zmq_bind_address</span> <span class="o">=</span> <span class="o">*</span>
</pre></div>
</div>
<p>Currently zmq driver uses dynamic port binding mechanism, which means that
each listener will allocate port of a random number. Ports range is controlled
by two options ‘rpc_zmq_min_port’ and ‘rpc_zmq_max_port’. Change them to
restrict current service’s port binding range. ‘rpc_zmq_bind_port_retries’
controls number of retries before ‘ports range exceeded’ failure.</p>
<p>For example:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">rpc_zmq_min_port</span> <span class="o">=</span> <span class="mi">9050</span>
<span class="n">rpc_zmq_max_port</span> <span class="o">=</span> <span class="mi">10050</span>
<span class="n">rpc_zmq_bind_port_retries</span> <span class="o">=</span> <span class="mi">100</span>
</pre></div>
</div>
</div>
<div class="section" id="devstack-support">
<h3>DevStack Support<a class="headerlink" href="#devstack-support" title="Permalink to this headline">¶</a></h3>
<p>ZeroMQ driver has been supported by DevStack. The configuration is as follows:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">ENABLED_SERVICES</span><span class="o">+=</span><span class="p">,</span><span class="o">-</span><span class="n">rabbit</span><span class="p">,</span><span class="n">zeromq</span>
<span class="n">ZEROMQ_MATCHMAKER</span><span class="o">=</span><span class="n">redis</span>
</pre></div>
</div>
<p>In local.conf [localrc] section need to enable zmq plugin which lives in
<a class="reference external" href="https://github.com/openstack/devstack-plugin-zmq.git">devstack-plugin-zmq</a> repository.</p>
<p>For example:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">enable_plugin</span> <span class="n">zmq</span> <span class="n">https</span><span class="p">:</span><span class="o">//</span><span class="n">github</span><span class="o">.</span><span class="n">com</span><span class="o">/</span><span class="n">openstack</span><span class="o">/</span><span class="n">devstack</span><span class="o">-</span><span class="n">plugin</span><span class="o">-</span><span class="n">zmq</span><span class="o">.</span><span class="n">git</span>
</pre></div>
</div>
<p>Example of local.conf:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="p">[[</span><span class="n">local</span><span class="o">|</span><span class="n">localrc</span><span class="p">]]</span>
<span class="n">DATABASE_PASSWORD</span><span class="o">=</span><span class="n">password</span>
<span class="n">ADMIN_PASSWORD</span><span class="o">=</span><span class="n">password</span>
<span class="n">SERVICE_PASSWORD</span><span class="o">=</span><span class="n">password</span>
<span class="n">SERVICE_TOKEN</span><span class="o">=</span><span class="n">password</span>
<span class="n">enable_plugin</span> <span class="n">zmq</span> <span class="n">https</span><span class="p">:</span><span class="o">//</span><span class="n">github</span><span class="o">.</span><span class="n">com</span><span class="o">/</span><span class="n">openstack</span><span class="o">/</span><span class="n">devstack</span><span class="o">-</span><span class="n">plugin</span><span class="o">-</span><span class="n">zmq</span><span class="o">.</span><span class="n">git</span>
<span class="n">OSLOMSG_REPO</span><span class="o">=</span><span class="n">https</span><span class="p">:</span><span class="o">//</span><span class="n">review</span><span class="o">.</span><span class="n">openstack</span><span class="o">.</span><span class="n">org</span><span class="o">/</span><span class="n">openstack</span><span class="o">/</span><span class="n">oslo</span><span class="o">.</span><span class="n">messaging</span>
<span class="n">OSLOMSG_BRANCH</span><span class="o">=</span><span class="n">master</span>
<span class="n">ZEROMQ_MATCHMAKER</span><span class="o">=</span><span class="n">redis</span>
<span class="n">LIBS_FROM_GIT</span><span class="o">=</span><span class="n">oslo</span><span class="o">.</span><span class="n">messaging</span>
<span class="n">ENABLE_DEBUG_LOG_LEVEL</span><span class="o">=</span><span class="kc">True</span>
</pre></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">ZeroMQ Driver Deployment Guide</a><ul>
<li><a class="reference internal" href="#introduction">Introduction</a></li>
<li><a class="reference internal" href="#abstract">Abstract</a></li>
<li><a class="reference internal" href="#scenario">Scenario</a></li>
<li><a class="reference internal" href="#configuration">Configuration</a><ul>
<li><a class="reference internal" href="#enabling-mandatory">Enabling (mandatory)</a></li>
<li><a class="reference internal" href="#match-making-mandatory">Match Making (mandatory)</a></li>
<li><a class="reference internal" href="#matchmaker-data-source-mandatory">MatchMaker Data Source (mandatory)</a></li>
<li><a class="reference internal" href="#ha-for-redis-database">HA for Redis database</a></li>
<li><a class="reference internal" href="#restrict-the-number-of-tcp-sockets-on-controller">Restrict the number of TCP sockets on controller</a></li>
<li><a class="reference internal" href="#listening-address-optional">Listening Address (optional)</a></li>
<li><a class="reference internal" href="#devstack-support">DevStack Support</a></li>
</ul>
</li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="AMQP1.0.html"
title="previous chapter">AMQP 1.0 Protocol Driver Deployment Guide</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="FAQ.html"
title="next chapter">Frequently Asked Questions</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/zmq_driver.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" size="18" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="FAQ.html" title="Frequently Asked Questions"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="AMQP1.0.html" title="AMQP 1.0 Protocol Driver Deployment Guide"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">oslo.messaging documentation</a> »</li>
</ul>
</div>
<div class="footer" role="contentinfo">
© Copyright 2016, OpenStack Foundation.
Last updated on September 26, 2016.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.8.
</div>
<script type="text/javascript">
try {
//Tracking docs.openstack.org/developer/<projectname> only
//The URL is built from the project variable in conf.py
var pageTracker = _gat._getTracker("UA-17511903-1");
pageTracker._setCookiePath("/developer/oslo.messaging");
pageTracker._trackPageview();
} catch(err) {}</script>
</body>
</html>
|