blob: b4a2b6b76ca2476dba67865a0e7d1b3dea311880 [file] [log] [blame]
<!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>YARN Mode - 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 = "YARN Mode";
var mkdocs_page_input_path = "deployment/deployment-yarn.md";
var mkdocs_page_url = "/deployment/deployment-yarn/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=" current">
<a class="current" href="index.html">YARN Mode</a>
<ul class="subnav">
<li class="toctree-l3"><a href="#how-to-launch-a-gearpump-cluster-on-yarn">How to launch a Gearpump cluster on YARN</a></li>
<li class="toctree-l3"><a href="#how-to-configure-the-resource-limitation-of-gearpump-cluster">How to configure the resource limitation of Gearpump cluster</a></li>
<li class="toctree-l3"><a href="#how-to-submit-a-application-to-gearpump-cluster">How to submit a application to Gearpump cluster.</a></li>
<li class="toctree-l3"><a href="#how-to-addremove-machines-dynamically">How to add/remove machines dynamically.</a></li>
<li class="toctree-l3"><a href="#other-usage">Other usage:</a></li>
</ul>
</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="">
<a class="" href="../deployment-ha/index.html">High Availability</a>
</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>
&nbsp;
</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> &raquo;</li>
<li>Deployment &raquo;</li>
<li>YARN Mode</li>
<li class="wy-breadcrumbs-aside">
<a href="https://github.com/apache/incubator-gearpump/edit/master/docs/contents/deployment/deployment-yarn.md"
class="icon icon-github"> Edit on GitHub</a>
</li>
</ul>
<hr/>
</div>
<div role="main">
<div class="section">
<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.8.4.zip</code> to remote HDFS Folder, suggest to put it under <code>/usr/lib/gearpump/gearpump-2.11-0.8.4.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 gear's home directory is <code>/user/gear</code></p>
</li>
<li>
<p>Put the YARN configurations under classpath.
Before calling <code>yarnclient launch</code>, 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>
<pre class="codehilite"><code class="language-bash">yarnclient launch -package /usr/lib/gearpump/gearpump-2.11-0.8.4.zip</code></pre>
<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 <code>gear.conf</code> 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>
<pre class="codehilite"><code class="language-bash">yarnclient launch -package /usr/lib/gearpump/gearpump-2.11-0.8.4.zip -output /tmp/mycluster.conf</code></pre>
<p>It will return in console like this:</p>
<pre class="codehilite"><code class="language-bash">==Application Id: application_1449802454214_0034</code></pre>
</li>
<li>
<p>Option 2: Query the active configuration file</p>
<pre class="codehilite"><code class="language-bash">yarnclient getconfig -appid &lt;yarn application id&gt; -output /tmp/mycluster.conf</code></pre>
<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>
<pre class="codehilite"><code class="language-bash">gear app -jar examples/wordcount-2.11-0.8.4.jar -conf /tmp/mycluster.conf</code></pre>
</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>
<pre class="codehilite"><code class="language-bash">storm -jar examples/storm-2.11-0.8.4.jar storm.starter.ExclamationTopology exclamation</code></pre>
</li>
<li>
<p>Now the application is running. To check this:</p>
<pre class="codehilite"><code class="language-bash">gear info -conf /tmp/mycluster.conf</code></pre>
</li>
<li>
<p>To Start a UI server, please do:</p>
<pre class="codehilite"><code class="language-bash">services -conf /tmp/mycluster.conf</code></pre>
<p>The default username and password is "admin:admin", you can check <a href="../deployment-ui-authentication">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>
<pre class="codehilite"><code class="language-bash">yarnclient query -appid &lt;yarn application id&gt;</code></pre>
<p>The console output will shows how many workers and masters there are. For example, I have output like this:</p>
<pre class="codehilite"><code class="language-bash">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>
</li>
<li>
<p>To add a new worker machine, you can do:</p>
<pre class="codehilite"><code class="language-bash">yarnclient addworker -appid &lt;yarn application id&gt; -count 2</code></pre>
<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>
<pre class="codehilite"><code class="language-bash">yarnclient removeworker -appid &lt;yarn application id&gt; -container &lt;worker container id&gt;</code></pre>
<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>
<pre class="codehilite"><code class="language-bash">yarnclient kill -appid &lt;yarn application id&gt;</code></pre>
<p><strong>NOTE:</strong> If the application is not launched successfully, then this command won't work. Please use "yarn application -kill <appId>" instead.</p>
</li>
<li>
<p>To check the Gearpump version</p>
<pre class="codehilite"><code class="language-bash">yarnclient version -appid &lt;yarn application id&gt;</code></pre>
</li>
</ol>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="../deployment-docker/index.html" class="btn btn-neutral float-right" title="Docker Mode">Next <span class="icon icon-circle-arrow-right"></span></a>
<a href="../deployment-standalone/index.html" class="btn btn-neutral" title="Standalone Mode"><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-standalone/index.html" style="color: #fcfcfc;">&laquo; Previous</a></span>
<span style="margin-left: 15px"><a href="../deployment-docker/index.html" style="color: #fcfcfc">Next &raquo;</a></span>
</span>
</div>
<script src="../../js/theme.js"></script>
</body>
</html>