| <!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 http-equiv="X-UA-Compatible" content="IE=edge"> |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| |
| |
| <link rel="shortcut icon" href="../../img/favicon.ico"> |
| <title>High Availability - Apache Gearpump(incubating)</title> |
| <link href='https://fonts.googleapis.com/css?family=Lato:400,700|Roboto+Slab:400,700|Inconsolata:400,700' rel='stylesheet' type='text/css'> |
| |
| <link rel="stylesheet" href="../../css/theme.css" type="text/css" /> |
| <link rel="stylesheet" href="../../css/theme_extra.css" type="text/css" /> |
| <link rel="stylesheet" href="../../css/highlight.css"> |
| |
| <script> |
| // Current page data |
| var mkdocs_page_name = "High Availability"; |
| var mkdocs_page_input_path = "deployment/deployment-ha.md"; |
| var mkdocs_page_url = "/deployment/deployment-ha/index.html"; |
| </script> |
| |
| <script src="../../js/jquery-2.1.1.min.js"></script> |
| <script src="../../js/modernizr-2.8.3.min.js"></script> |
| <script type="text/javascript" src="../../js/highlight.pack.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 stickynav"> |
| <div class="wy-side-nav-search"> |
| <a href="../../index.html" class="icon icon-home"> Apache Gearpump(incubating)</a> |
| <div role="search"> |
| <form id ="rtd-search-form" class="wy-form" action="../../search.html" method="get"> |
| <input type="text" name="q" placeholder="Search docs" /> |
| </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="" href="../../index.html">Overview</a> |
| </li> |
| |
| <li class="toctree-l1"> |
| |
| <span class="caption-text">Introduction</span> |
| <ul class="subnav"> |
| <li class=""> |
| |
| <a class="" href="../../introduction/submit-your-1st-application/index.html">Submit Your 1st Application</a> |
| </li> |
| <li class=""> |
| |
| <a class="" href="../../introduction/commandline/index.html">Client Command Line</a> |
| </li> |
| <li class=""> |
| |
| <a class="" href="../../introduction/basic-concepts/index.html">Basic Concepts</a> |
| </li> |
| <li class=""> |
| |
| <a class="" href="../../introduction/features/index.html">Technical Highlights</a> |
| </li> |
| <li class=""> |
| |
| <a class="" href="../../introduction/message-delivery/index.html">Reliable Message Delivery</a> |
| </li> |
| <li class=""> |
| |
| <a class="" href="../../introduction/performance-report/index.html">Performance</a> |
| </li> |
| </ul> |
| </li> |
| |
| <li class="toctree-l1"> |
| |
| <span class="caption-text">Deployment</span> |
| <ul class="subnav"> |
| <li class=""> |
| |
| <a class="" href="../deployment-local/index.html">Local Mode</a> |
| </li> |
| <li class=""> |
| |
| <a class="" href="../deployment-standalone/index.html">Standalone Mode</a> |
| </li> |
| <li class=""> |
| |
| <a class="" href="../deployment-yarn/index.html">YARN Mode</a> |
| </li> |
| <li class=""> |
| |
| <a class="" href="../deployment-docker/index.html">Docker Mode</a> |
| </li> |
| <li class=""> |
| |
| <a class="" href="../deployment-ui-authentication/index.html">UI Authentication</a> |
| </li> |
| <li class=" current"> |
| |
| <a class="current" href="index.html">High Availability</a> |
| <ul class="subnav"> |
| |
| <li class="toctree-l3"><a href="#1-configure">1. Configure.</a></li> |
| |
| <ul> |
| |
| <li><a class="toctree-l4" href="#select-master-machines">Select master machines</a></li> |
| |
| <li><a class="toctree-l4" href="#configure-distributed-storage-to-store-application-jars">Configure distributed storage to store application jars.</a></li> |
| |
| </ul> |
| |
| |
| <li class="toctree-l3"><a href="#2-start-daemon">2. Start Daemon.</a></li> |
| |
| |
| <li class="toctree-l3"><a href="#3-done">3. Done!</a></li> |
| |
| |
| </ul> |
| </li> |
| <li class=""> |
| |
| <a class="" href="../deployment-msg-delivery/index.html">Reliable Message Delivery</a> |
| </li> |
| <li class=""> |
| |
| <a class="" href="../deployment-configuration/index.html">Configuration</a> |
| </li> |
| <li class=""> |
| |
| <a class="" href="../deployment-resource-isolation/index.html">Resource Isolation</a> |
| </li> |
| <li class=""> |
| |
| <a class="" href="../deployment-security/index.html">YARN Security Guide</a> |
| </li> |
| <li class=""> |
| |
| <a class="" href="../get-gearpump-distribution/index.html">How to Get Your Gearpump Distribution</a> |
| </li> |
| <li class=""> |
| |
| <a class="" href="../hardware-requirement/index.html">Hardware Requirement</a> |
| </li> |
| </ul> |
| </li> |
| |
| <li class="toctree-l1"> |
| |
| <span class="caption-text">Programming Guide</span> |
| <ul class="subnav"> |
| <li class=""> |
| |
| <a class="" href="../../dev/dev-write-1st-app/index.html">Write Your 1st App</a> |
| </li> |
| <li class=""> |
| |
| <a class="" href="../../dev/dev-custom-serializer/index.html">Customized Message Passing</a> |
| </li> |
| <li class=""> |
| |
| <a class="" href="../../dev/dev-connectors/index.html">Gearpump Connectors</a> |
| </li> |
| <li class=""> |
| |
| <a class="" href="../../dev/dev-storm/index.html">Storm Compatibility</a> |
| </li> |
| <li class=""> |
| |
| <a class="" href="../../dev/dev-ide-setup/index.html">IDE Setup</a> |
| </li> |
| <li class=""> |
| |
| <a class="" href="../../dev/dev-non-streaming-example/index.html">Non Streaming Examples</a> |
| </li> |
| <li class=""> |
| |
| <a class="" href="../../dev/dev-rest-api/index.html">REST API</a> |
| </li> |
| <li class=""> |
| |
| <a class="" href="../../api/scala/index.html">Scala API</a> |
| </li> |
| <li class=""> |
| |
| <a class="" href="../../api/java/index.html">Java API</a> |
| </li> |
| </ul> |
| </li> |
| |
| <li class="toctree-l1"> |
| |
| <span class="caption-text">Internals</span> |
| <ul class="subnav"> |
| <li class=""> |
| |
| <a class="" href="../../internals/gearpump-internals/index.html">Gearpump Internals</a> |
| </li> |
| </ul> |
| </li> |
| |
| </ul> |
| </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">Apache Gearpump(incubating)</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> »</li> |
| |
| |
| |
| <li>Deployment »</li> |
| |
| |
| |
| <li>High Availability</li> |
| <li class="wy-breadcrumbs-aside"> |
| |
| <a href="https://github.com/apache/incubator-gearpump/edit/master/docs/contents/deployment/deployment-ha.md" |
| class="icon icon-github"> Edit on GitHub</a> |
| |
| </li> |
| </ul> |
| <hr/> |
| </div> |
| <div role="main"> |
| <div class="section"> |
| |
| <p>To support HA, we allow to start master on multiple nodes. They will form a quorum to decide consistency. For example, if we start master on 5 nodes and 2 nodes are down, then the cluster is still consistent and functional.</p> |
| <p>Here are the steps to enable the HA mode:</p> |
| <h3 id="1-configure">1. Configure.</h3> |
| <h4 id="select-master-machines">Select master machines</h4> |
| <p>Distribute the package to all nodes. Modify <code>conf/gear.conf</code> on all nodes. You MUST configure</p> |
| <pre class="codehilite"><code class="language-bash">gearpump.hostname</code></pre> |
| |
| |
| <p>to make it point to your hostname(or ip), and</p> |
| <pre class="codehilite"><code class="language-bash">gearpump.cluster.masters</code></pre> |
| |
| |
| <p>to a list of master nodes. For example, if I have 3 master nodes (node1, node2, and node3), then the <code>gearpump.cluster.masters</code> can be set as</p> |
| <pre class="codehilite"><code class="language-bash">gearpump.cluster { |
| masters = ["node1:3000", "node2:3000", "node3:3000"] |
| }</code></pre> |
| |
| |
| <h4 id="configure-distributed-storage-to-store-application-jars">Configure distributed storage to store application jars.</h4> |
| <p>In <code>conf/gear.conf</code>, For entry <code>gearpump.jarstore.rootpath</code>, please choose the storage folder for application jars. You need to make sure this jar storage is highly available. We support two storage systems:</p> |
| <p>1). HDFS</p> |
| <p>You need to configure the <code>gearpump.jarstore.rootpath</code> like this</p> |
| <pre class="codehilite"><code class="language-bash">hdfs://host:port/path/</code></pre> |
| |
| |
| <p>For HDFS HA,</p> |
| <pre class="codehilite"><code class="language-bash"></code></pre> |
| |
| |
| <p>hdfs://namespace/path/</p> |
| <p>2). Shared NFS folder</p> |
| <p>First you need to map the NFS directory to local directory(same path) on all machines of master nodes. |
| Then you need to set the <code>gearpump.jarstore.rootpath</code> like this:</p> |
| <pre class="codehilite"><code class="language-bash">file:///your_nfs_mapping_directory</code></pre> |
| |
| |
| <p>3). If you don't set this value, we will use the local directory of master node. |
| NOTE! There is no HA guarantee in this case, which means we are unable to recover running applications when master goes down.</p> |
| <h3 id="2-start-daemon">2. Start Daemon.</h3> |
| <p>On node1, node2, node3, Start Master</p> |
| <pre class="codehilite"><code class="language-bash">## on node1 |
| bin/master -ip node1 -port 3000 |
| |
| ## on node2 |
| bin/master -ip node2 -port 3000 |
| |
| ## on node3 |
| bin/master -ip node3 -port 3000</code></pre> |
| |
| |
| <h3 id="3-done">3. Done!</h3> |
| <p>Now you have a highly available HA cluster. You can kill any node, the master HA will take effect.</p> |
| <p><strong>NOTE</strong>: It can take up to 15 seconds for master node to fail-over. You can change the fail-over timeout time by adding config in <code>gear.conf</code> <code>gearpump-master.akka.cluster.auto-down-unreachable-after=10s</code> or set it to a smaller value</p> |
| |
| </div> |
| </div> |
| <footer> |
| |
| <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> |
| |
| <a href="../deployment-msg-delivery/index.html" class="btn btn-neutral float-right" title="Reliable Message Delivery">Next <span class="icon icon-circle-arrow-right"></span></a> |
| |
| |
| <a href="../deployment-ui-authentication/index.html" class="btn btn-neutral" title="UI Authentication"><span class="icon icon-circle-arrow-left"></span> Previous</a> |
| |
| </div> |
| |
| |
| <hr/> |
| |
| <div role="contentinfo"> |
| <!-- Copyright etc --> |
| |
| </div> |
| |
| Built with <a href="http://www.mkdocs.org">MkDocs</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> |
| |
| <div class="rst-versions" role="note" style="cursor: pointer"> |
| <span class="rst-current-version" data-toggle="rst-current-version"> |
| |
| <a href="https://github.com/apache/incubator-gearpump" class="fa fa-github" style="float: left; color: #fcfcfc"> GitHub</a> |
| |
| |
| <span><a href="../deployment-ui-authentication/index.html" style="color: #fcfcfc;">« Previous</a></span> |
| |
| |
| <span style="margin-left: 15px"><a href="../deployment-msg-delivery/index.html" style="color: #fcfcfc">Next »</a></span> |
| |
| </span> |
| </div> |
| <script src="../../js/theme.js"></script> |
| |
| </body> |
| </html> |