CINXE.COM
images/mcrouter - operations/docker-images/production-images - Gitiles
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>images/mcrouter - operations/docker-images/production-images - Gitiles</title><link rel="stylesheet" type="text/css" href="/r/plugins/gitiles/+static/base.css"><link rel="stylesheet" type="text/css" href="/r/plugins/gitiles/+static/doc.css"><link rel="stylesheet" type="text/css" href="/r/plugins/gitiles/+static/prettify/prettify.css"><!-- default customHeadTagPart --></head><body class="Site"><header class="Site-header"><div class="Header"><!-- default customHeader --><div class="Header-title">Gitiles</div><div class="Header-menu"> <a class="Header-menuItem" href="https://gerrit.wikimedia.org/r/">Code Review</a> <a class="Header-menuItem" href="https://gerrit.wikimedia.org/r/login/plugins%2Fgitiles%2Foperations%2Fdocker-images%2Fproduction-images%2F%252B%2Frefs%2Fheads%2Fmaster%2Fimages%2Fmcrouter%2F">Sign In</a> </div></div></header><div class="Site-content"><div class="Container "><div class="Breadcrumbs"><a class="Breadcrumbs-crumb" href="/r/plugins/gitiles/?format=HTML">gerrit.wikimedia.org</a> / <a class="Breadcrumbs-crumb" href="/r/plugins/gitiles/operations/">operations</a> / <a class="Breadcrumbs-crumb" href="/r/plugins/gitiles/operations/docker-images/">docker-images</a> / <a class="Breadcrumbs-crumb" href="/r/plugins/gitiles/operations/docker-images/production-images/">production-images</a> / <a class="Breadcrumbs-crumb" href="/r/plugins/gitiles/operations/docker-images/production-images/+/refs/heads/master">refs/heads/master</a> / <a class="Breadcrumbs-crumb" href="/r/plugins/gitiles/operations/docker-images/production-images/+/refs/heads/master/">.</a> / <a class="Breadcrumbs-crumb" href="/r/plugins/gitiles/operations/docker-images/production-images/+/refs/heads/master/images">images</a> / <span class="Breadcrumbs-crumb">mcrouter</span></div><div class="TreeDetail"><div class="u-sha1 u-monospace TreeDetail-sha1">tree: 5125d57bfcc9a3f8dfc2cc5bad25216dc01584f8 [<a href="/r/plugins/gitiles/operations/docker-images/production-images/+log/refs/heads/master/images/mcrouter">path history</a>] <span>[<a href="/r/plugins/gitiles/operations/docker-images/production-images/+archive/refs/heads/master/images/mcrouter.tar.gz">tgz</a>]</span></div><ol class="FileList"><li class="FileList-item FileList-item--gitTree" title="Tree - test/"><a class="FileList-itemLink" href="/r/plugins/gitiles/operations/docker-images/production-images/+/refs/heads/master/images/mcrouter/test/">test/</a></li><li class="FileList-item FileList-item--regularFile" title="Regular file - .dockerignore"><a class="FileList-itemLink" href="/r/plugins/gitiles/operations/docker-images/production-images/+/refs/heads/master/images/mcrouter/.dockerignore">.dockerignore</a></li><li class="FileList-item FileList-item--regularFile" title="Regular file - changelog"><a class="FileList-itemLink" href="/r/plugins/gitiles/operations/docker-images/production-images/+/refs/heads/master/images/mcrouter/changelog">changelog</a></li><li class="FileList-item FileList-item--regularFile" title="Regular file - control"><a class="FileList-itemLink" href="/r/plugins/gitiles/operations/docker-images/production-images/+/refs/heads/master/images/mcrouter/control">control</a></li><li class="FileList-item FileList-item--regularFile" title="Regular file - Dockerfile.template"><a class="FileList-itemLink" href="/r/plugins/gitiles/operations/docker-images/production-images/+/refs/heads/master/images/mcrouter/Dockerfile.template">Dockerfile.template</a></li><li class="FileList-item FileList-item--executableFile" title="Executable file - entrypoint.sh"><a class="FileList-itemLink" href="/r/plugins/gitiles/operations/docker-images/production-images/+/refs/heads/master/images/mcrouter/entrypoint.sh">entrypoint.sh</a></li><li class="FileList-item FileList-item--executableFile" title="Executable file - healthz.sh"><a class="FileList-itemLink" href="/r/plugins/gitiles/operations/docker-images/production-images/+/refs/heads/master/images/mcrouter/healthz.sh">healthz.sh</a></li><li class="FileList-item FileList-item--regularFile" title="Regular file - README.md"><a class="FileList-itemLink" href="/r/plugins/gitiles/operations/docker-images/production-images/+/refs/heads/master/images/mcrouter/README.md">README.md</a></li><li class="FileList-item FileList-item--executableFile" title="Executable file - test.sh"><a class="FileList-itemLink" href="/r/plugins/gitiles/operations/docker-images/production-images/+/refs/heads/master/images/mcrouter/test.sh">test.sh</a></li></ol><div class="InlineReadme"><div class="InlineReadme-path">images/mcrouter/README.md</div><div class="doc"><h1><a class="h" name="Mcrouter-image" href="#Mcrouter-image"><span></span></a><a class="h" name="mcrouter-image" href="#mcrouter-image"><span></span></a>Mcrouter image</h1><p>This docker image allows running an mcrouter image.</p><p>It supports setting up listening to TLS.</p><h2><a class="h" name="Running" href="#Running"><span></span></a><a class="h" name="running" href="#running"><span></span></a>Running</h2><p>Several environment variables can be set to control the command-line behaviour. Most importantly, setting <code class="code">USE_SSL=yes</code> will have mcrouter listen on the port defined in <code class="code">SSL_PORT</code> or not. See below for all the environment variables you can define.</p><table><thead><tr><th>CLI option</th><th>Environment variable</th><th>Default value</th></tr></thead><tbody><tr><td><code class="code">--route-prefix</code></td><td><code class="code">ROUTE_PREFIX</code></td><td>/default/cluster</td></tr><tr><td><code class="code">--cross-region-timeout-ms</code></td><td><code class="code">CROSS_REGION_TO</code></td><td>250</td></tr><tr><td><code class="code">--cross-cluster-timeout-ms</code></td><td><code class="code">CROSS_CLUSTER_TO</code></td><td>1000</td></tr><tr><td><code class="code">--num-proxies</code></td><td><code class="code">NUM_PROXIES</code></td><td>1</td></tr><tr><td><code class="code">--probe-timeout-initial</code></td><td><code class="code">PROBE_TIMEOUT</code></td><td>10000</td></tr><tr><td><code class="code">--timeouts-until-tko</code></td><td><code class="code">TIMEOUTS_UNTIL_TKO</code></td><td>5</td></tr><tr><td><code class="code">--config</code></td><td><code class="code">CONFIG</code></td><td>file:/etc/mcrouter/config.json</td></tr></tbody></table><p>You will need to provide the following volumes:</p><ul><li><code class="code">/etc/mcrouter/config.json</code> with the full configuration for routes (or override the CONFIG env variable)</li><li>If you want to extract stats and/or debug mcrouter, <code class="code">/var/lib/mcrouter/{fifos,stats}</code></li><li>If you want to use TLS, <code class="code">/etc/mcrouter/ssl</code> should be mounted, containing:<ul><li>the private key at <code class="code">key.pem</code></li><li>the public cert at <code class="code">cert.pem</code></li><li>the CA cert at <code class="code">ca.pem</code></li></ul></li></ul><h2><a class="h" name="Example" href="#Example"><span></span></a><a class="h" name="example" href="#example"><span></span></a>Example</h2><pre class="code">CONF='{"pools":{"A":{"servers":["127.0.0.1:5001"]}}, "route":"PoolRoute|A"}' docker run --rm -p 5001:5001 -e CONFIG="$CONF" \ docker-registry.wikimedia.org/mcrouter:latest </pre></div></div></div></div> <!-- Container --></div> <!-- Site-content --><!-- default customFooter --><footer class="Site-footer"><div class="Footer"><span class="Footer-poweredBy">Powered by <a href="https://gerrit.googlesource.com/gitiles/">Gitiles</a></span><span class="Footer-formats"><a class="u-monospace Footer-formatsItem" href="?format=TEXT">txt</a> <a class="u-monospace Footer-formatsItem" href="?format=JSON">json</a></span></div></footer></body></html>