| <!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>Deployment with YARN - Gearpump 0.7.5 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"> |
| <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"> |
| <span class="sr-only">Toggle navigation</span> |
| <span class="icon-bar"></span> |
| <span class="icon-bar"></span> |
| <span class="icon-bar"></span> |
| </button> |
| <a class="navbar-brand" href="http://gearpump.io">Gearpump |
| <span class="label label-primary" style="font-size: .6em">0.7.5</span> |
| </a> |
| </div> |
| <div id="navbar" 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-local.html">Local Mode</a><li> |
| <li><a href="deployment-standalone.html">Standalone Mode</a></li> |
| <li><a href="deployment-yarn.html">YARN Mode</a></li> |
| <li><a href="deployment-docker.html">Docker Mode</a><li> |
| <li class="divider"></li> |
| <li><a href="deployment-ui-authentication.html">UI Authentication</a></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><a href="deployment-resource-isolation.html">Resource Isolation</a></li> |
| <li class="divider"></li> |
| <li><a href="deployment-security.html">YARN Security Guide</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">Deployment with YARN</h1> |
| |
| |
| <h2 id="how-to-launch-a-gearpump-cluster-on-yarn">How to launch a Gearpump cluster on YARN</h2> |
| |
| <ol> |
| <li> |
| <p>Upload the <code>gearpump-2.11-0.7.5.zip</code> to remote HDFS Folder, suggest to put it under <code>/usr/lib/gearpump/gearpump-2.11-0.7.5.zip</code></p> |
| </li> |
| <li> |
| <p>Make sure the home directory on HDFS is already created and all read-write rights are granted for user. For example, user <code>gear</code>’s home directory is <code>/user/gear</code></p> |
| </li> |
| <li> |
| <p>Put the YARN configurations under classpath. |
| Before calling “yarnclient launch”, make sure you have put all yarn configuration files under classpath. |
| Typically, you can just copy all files under <code>$HADOOP_HOME/etc/hadoop</code> from one of the YARN Cluster machine to <code>conf/yarnconf</code> of gearpump. |
| <code>$HADOOP_HOME</code> points to the Hadoop installation directory.</p> |
| </li> |
| <li> |
| <p>Launch the gearpump cluster on YARN</p> |
| |
| <div class="highlight"><pre><code> yarnclient launch -package /usr/lib/gearpump/gearpump-2.11-0.7.5.zip |
| </code></pre></div> |
| |
| <p>If you don’t specify package path, it will read default package-path (<code>gearpump.yarn.client.package-path</code>) from <code>gear.conf</code>.</p> |
| |
| <p><strong>NOTE:</strong> You may need to execute <code>chmod +x bin/*</code> in shell to make the script file <code>yarnclient</code> executable.</p> |
| </li> |
| <li> |
| <p>After launching, you can browser the Gearpump UI via YARN resource manager dashboard.</p> |
| </li> |
| </ol> |
| |
| <h2 id="how-to-configure-the-resource-limitation-of-gearpump-cluster">How to configure the resource limitation of Gearpump cluster</h2> |
| |
| <p>Before launching a Gearpump cluster, please change configuration section <code>gearpump.yarn</code> in gear.conf to configure the resource limitation, like:</p> |
| |
| <ol> |
| <li>The number of worker containers.</li> |
| <li>The YARN container memory size for worker and master.</li> |
| </ol> |
| |
| <h2 id="how-to-submit-a-application-to-gearpump-cluster">How to submit a application to Gearpump cluster.</h2> |
| |
| <p>To submit the jar to the Gearpump cluster, we first need to know the Master address, so we need to get |
| a active configuration file first.</p> |
| |
| <p>There are two ways to get an active configuration file:</p> |
| |
| <ol> |
| <li> |
| <p>Option 1: specify “-output” option when you launch the cluster.</p> |
| |
| <div class="highlight"><pre><code> yarnclient launch -package /usr/lib/gearpump/gearpump-2.11-0.7.5.zip -output /tmp/mycluster.conf |
| </code></pre></div> |
| |
| <p>It will return in console like this:</p> |
| |
| <div class="highlight"><pre><code>================================================ |
| ==Application Id: application_1449802454214_0034 |
| </code></pre></div> |
| </li> |
| <li> |
| <p>Option 2: Query the active configuration file</p> |
| |
| <div class="highlight"><pre><code> yarnclient getconfig -appid <yarn application id> -output /tmp/mycluster.conf |
| </code></pre></div> |
| |
| <p>yarn application id can be found from the output of step1 or from YARN dashboard.</p> |
| </li> |
| <li> |
| <p>After you downloaded the configuration file, you can launch application with that config file.</p> |
| |
| <div class="highlight"><pre><code> gear app -jar examples/wordcount-2.11-0.7.5.jar -conf /tmp/mycluster.conf |
| </code></pre></div> |
| </li> |
| <li> |
| <p>To run Storm application over Gearpump on YARN, please store the configuration file with <code>-output application.conf</code> |
| and then launch Storm application with</p> |
| |
| <div class="highlight"><pre><code> storm -jar examples/storm-2.11-0.7.5.jar storm.starter.ExclamationTopology exclamation |
| </code></pre></div> |
| </li> |
| <li> |
| <p>Now the application is running. To check this:</p> |
| |
| <div class="highlight"><pre><code>gear info -conf /tmp/mycluster.conf |
| </code></pre></div> |
| </li> |
| <li> |
| <p>To Start a UI server, please do: |
| <code> |
| services -conf /tmp/mycluster.conf |
| </code> |
| The default username and password is “admin:admin”, you can check |
| <a href="deployment-ui-authentication.html">UI Authentication</a> to find how to manage users.</p> |
| </li> |
| </ol> |
| |
| <h2 id="how-to-addremove-machines-dynamically">How to add/remove machines dynamically.</h2> |
| |
| <p>Gearpump yarn tool allows to dynamically add/remove machines. Here is the steps:</p> |
| |
| <ol> |
| <li> |
| <p>First, query to get active resources.</p> |
| |
| <div class="highlight"><pre><code>yarnclient query -appid <yarn application id> |
| </code></pre></div> |
| |
| <p>The console output will shows how many workers and masters there are. For example, I have output like this:</p> |
| |
| <div class="highlight"><pre><code> masters: |
| container_1449802454214_0034_01_000002(IDHV22-01:35712) |
| workers: |
| container_1449802454214_0034_01_000003(IDHV22-01:35712) |
| container_1449802454214_0034_01_000006(IDHV22-01:35712) |
| </code></pre></div> |
| </li> |
| <li> |
| <p>To add a new worker machine, you can do:</p> |
| |
| <div class="highlight"><pre><code>yarnclient addworker -appid <yarn application id> -count 2 |
| </code></pre></div> |
| |
| <p>This will add two new workers machines. Run the command in first step to check whether the change is effective.</p> |
| </li> |
| <li> |
| <p>To remove old machines, use:</p> |
| |
| <div class="highlight"><pre><code>yarnclient removeworker -appid <yarn application id> -container <worker container id> |
| </code></pre></div> |
| |
| <p>The worker container id can be found from the output of step 1. For example “container_1449802454214_0034_01_000006” is a good container id.</p> |
| </li> |
| </ol> |
| |
| <h2 id="other-usage">Other usage:</h2> |
| <ol> |
| <li> |
| <p>To kill a cluster,</p> |
| |
| <div class="highlight"><pre><code>yarnclient kill -appid <yarn application id> |
| </code></pre></div> |
| |
| <p><strong>NOTE:</strong> If the application is not launched successfully, then this command won’t work. Please use “yarn application -kill <appid>" instead.</appid></p> |
| </li> |
| <li> |
| <p>To check the Gearpump version</p> |
| |
| <div class="highlight"><pre><code>yarnclient version -appid <yarn application id> |
| </code></pre></div> |
| </li> |
| </ol> |
| |
| |
| </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> |