| <!DOCTYPE html> |
| <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> |
| <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]--> |
| <!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]--> |
| <!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]--> |
| <head> |
| <meta charset="utf-8"> |
| <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1"/> |
| <title>Gearpump High Availability Guide - Gearpump 0.7.2 Documentation</title> |
| |
| |
| |
| |
| <link rel="stylesheet" href="css/bootstrap-3.3.5.min.css"> |
| <style> |
| body { |
| padding-top: 60px; |
| padding-bottom: 40px; |
| } |
| </style> |
| <link rel="stylesheet" href="css/main.css"> |
| <link rel="stylesheet" href="css/pygments-default.css"> |
| <script src="js/vendor/modernizr-2.6.1-respond-1.1.0.min.js"></script> |
| </head> |
| <body> |
| <!--[if lt IE 7]> |
| <p class="chromeframe">You are using an outdated browser. <a href="http://browsehappy.com/">Upgrade your browser today</a> or <a href="http://www.google.com/chromeframe/?redirect=true">install Google Chrome Frame</a> to better experience this site.</p> |
| <![endif]--> |
| |
| <div class="navbar navbar-inverse navbar-fixed-top" id="topbar"> |
| <div class="container"> |
| <div class="navbar-header"> |
| <a class="navbar-brand" href="http://gearpump.io">Gearpump |
| <span class="label label-primary" style="font-size: .6em">0.7.2</span> |
| </a> |
| </div> |
| <div class="collapse navbar-collapse"> |
| <ul class="nav navbar-nav"> |
| <li><a href="index.html">Overview</a></li> |
| |
| <li class="dropdown"> |
| <a href="#" class="dropdown-toggle" data-toggle="dropdown">Introduction<b class="caret"></b></a> |
| <ul class="dropdown-menu"> |
| <li><a href="submit-your-1st-application.html">Submit Your 1st Application</a></li> |
| <li><a href="commandline.html">Client Command Line</a></li> |
| <li class="divider"></li> |
| <li><a href="basic-concepts.html">Basic Concepts</a></li> |
| <li><a href="features.html">Technical Highlights</a></li> |
| <li><a href="message-delivery.html">Reliable Message Delivery</a></li> |
| <li><a href="performance-report.html">Performance</a></li> |
| <li><a href="gearpump-internals.html">Gearpump Internals</a></li> |
| </ul> |
| </li> |
| |
| <li class="dropdown"> |
| <a href="#" class="dropdown-toggle" data-toggle="dropdown">Deploying<b class="caret"></b></a> |
| <ul class="dropdown-menu"> |
| <li class="dropdown-header">Deployment</li> |
| <li><a href="deployment-docker.html">Docker</a><li> |
| <li><a href="deployment-local.html">Local</a><li> |
| <li><a href="deployment-standalone.html">Standalone</a></li> |
| <li><a href="deployment-yarn.html">YARN</a></li> |
| <li class="divider"></li> |
| <li><a href="deployment-ha.html">High Availability</a></li> |
| <li><a href="deployment-msg-delivery.html">Reliable Message Delivery</a></li> |
| <li><a href="deployment-configuration.html">Configuration</a></li> |
| <li class="divider"></li> |
| <li><a href="deployment-security.html">Security</a></li> |
| </ul> |
| </li> |
| |
| <li class="dropdown"> |
| <a href="#" class="dropdown-toggle" data-toggle="dropdown">Programming Guide<b class="caret"></b></a> |
| <ul class="dropdown-menu"> |
| <li><a href="dev-write-1st-app.html">Write Your 1st App</a></li> |
| <li><a href="dev-custom-serializer.html">Customized Message Passing</a></li> |
| <li class="divider"></li> |
| <li><a href="api/scala/index.html">Scala API</a></li> |
| <li><a href="api/java/index.html">Java API</a></li> |
| <li><a href="dev-rest-api.html">RESTful API</a></li> |
| <li class="divider"></li> |
| <li><a href="dev-connectors.html">Gearpump Connectors</a></li> |
| <li class="divider"></li> |
| <li><a href="dev-storm.html">Storm Compatibility</a></li> |
| <!-- |
| <li><a href="dev-samoa.html">Samoa Compatibility</a></li> |
| <li class="divider"></li> |
| <li><a href="dev-iot.html">Gearpump with IoT</a></li> |
| --> |
| </ul> |
| </li> |
| |
| <li class="dropdown"> |
| <a href="#" class="dropdown-toggle" data-toggle="dropdown">More<b class="caret"></b></a> |
| <ul class="dropdown-menu"> |
| <li><a href="how-to-contribute.html">How to Contribute</a></li> |
| <li><a href="coding-style.html">Coding Style</a></li> |
| <li class="divider"></li> |
| <li><a href="faq.html">FAQ</a><li> |
| <li><a href="about.html">About</a></li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| </div> |
| </div> |
| |
| <div class="container" id="content"> |
| |
| <h1 class="title">Gearpump High Availability Guide</h1> |
| |
| |
| <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="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> |
| |
| <div class="highlight"><pre><code class="language-bash">gearpump.hostname</code></pre></div> |
| <p>to make it point to your hostname(or ip), and</p> |
| |
| <div class="highlight"><pre><code class="language-bash">gearpump.cluster.masters</code></pre></div> |
| <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> |
| |
| <div class="highlight"><pre><code class="language-bash"> gearpump.cluster <span class="o">{</span> |
| <span class="nv">masters</span> <span class="o">=</span> <span class="o">[</span><span class="s2">"node1:3000"</span>, <span class="s2">"node2:3000"</span>, <span class="s2">"node3:3000"</span><span class="o">]</span> |
| <span class="o">}</span></code></pre></div> |
| |
| <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 |
| You need to configure the <code>gearpump.jarstore.rootpath</code> like this</p> |
| |
| <div class="highlight"><pre><code class="language-bash"> hdfs://host:port/path/</code></pre></div> |
| |
| <p>2). Shared NFS folder |
| 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> |
| |
| <div class="highlight"><pre><code class="language-bash"> file:///your_nfs_mapping_directory</code></pre></div> |
| |
| <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="start-daemon">2. Start Daemon.</h3> |
| |
| <p>On node1, node2, node3, Start Master</p> |
| |
| <div class="highlight"><pre><code class="language-bash"> <span class="c">## on node1</span> |
| bin/master -ip node1 -port 3000 |
| |
| <span class="c">## on node2</span> |
| bin/master -ip node2 -port 3000 |
| |
| <span class="c">## on node3</span> |
| bin/master -ip node3 -port 3000</code></pre></div> |
| |
| <h3 id="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>master.akka.cluster.auto-down-unreachable-after=10s</code> or set it to a smaller value</p> |
| |
| |
| </div> <!-- /container --> |
| |
| <script src="js/vendor/jquery-2.1.4.min.js"></script> |
| <script src="js/vendor/bootstrap-3.3.5.min.js"></script> |
| <script src="js/vendor/anchor-1.1.1.min.js"></script> |
| <script src="js/main.js"></script> |
| |
| <!-- MathJax Section --> |
| <script type="text/x-mathjax-config"> |
| MathJax.Hub.Config({ |
| TeX: { equationNumbers: { autoNumber: "AMS" } } |
| }); |
| </script> |
| <script> |
| // Note that we load MathJax this way to work with local file (file://), HTTP and HTTPS. |
| // We could use "//cdn.mathjax...", but that won't support "file://". |
| (function(d, script) { |
| script = d.createElement('script'); |
| script.type = 'text/javascript'; |
| script.async = true; |
| script.onload = function(){ |
| MathJax.Hub.Config({ |
| tex2jax: { |
| inlineMath: [ ["$", "$"], ["\\\\(","\\\\)"] ], |
| displayMath: [ ["$$","$$"], ["\\[", "\\]"] ], |
| processEscapes: true, |
| skipTags: ['script', 'noscript', 'style', 'textarea', 'pre'] |
| } |
| }); |
| }; |
| script.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + |
| 'cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'; |
| d.getElementsByTagName('head')[0].appendChild(script); |
| }(document)); |
| </script> |
| </body> |
| </html> |