blob: 6ad4879d6608a1099064a630d7d89a351c61c766 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--
| Generated by Apache Maven Doxia at 2021-06-15
| Rendered using Apache Maven Stylus Skin 1.5
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Apache Hadoop 3.3.1 &#x2013; YARN Service Examples</title>
<style type="text/css" media="all">
@import url("../css/maven-base.css");
@import url("../css/maven-theme.css");
@import url("../css/site.css");
</style>
<link rel="stylesheet" href="../css/print.css" type="text/css" media="print" />
<meta name="Date-Revision-yyyymmdd" content="20210615" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body class="composite">
<div id="banner">
<a href="http://hadoop.apache.org/" id="bannerLeft">
<img src="http://hadoop.apache.org/images/hadoop-logo.jpg" alt="" />
</a>
<a href="http://www.apache.org/" id="bannerRight">
<img src="http://www.apache.org/images/asf_logo_wide.png" alt="" />
</a>
<div class="clear">
<hr/>
</div>
</div>
<div id="breadcrumbs">
<div class="xleft">
<a href="http://www.apache.org/" class="externalLink">Apache</a>
&gt;
<a href="http://hadoop.apache.org/" class="externalLink">Hadoop</a>
&gt;
<a href="../../index.html">Apache Hadoop YARN</a>
&gt;
<a href="../index.html">Apache Hadoop 3.3.1</a>
&gt;
YARN Service Examples
</div>
<div class="xright"> <a href="http://wiki.apache.org/hadoop" class="externalLink">Wiki</a>
|
<a href="https://gitbox.apache.org/repos/asf/hadoop.git" class="externalLink">git</a>
|
<a href="http://hadoop.apache.org/" class="externalLink">Apache Hadoop</a>
&nbsp;| Last Published: 2021-06-15
&nbsp;| Version: 3.3.1
</div>
<div class="clear">
<hr/>
</div>
</div>
<div id="leftColumn">
<div id="navcolumn">
<h5>General</h5>
<ul>
<li class="none">
<a href="../../../index.html">Overview</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-common/SingleCluster.html">Single Node Setup</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-common/ClusterSetup.html">Cluster Setup</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-common/CommandsManual.html">Commands Reference</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-common/FileSystemShell.html">FileSystem Shell</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-common/Compatibility.html">Compatibility Specification</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-common/DownstreamDev.html">Downstream Developer's Guide</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-common/AdminCompatibilityGuide.html">Admin Compatibility Guide</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-common/InterfaceClassification.html">Interface Classification</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-common/filesystem/index.html">FileSystem Specification</a>
</li>
</ul>
<h5>Common</h5>
<ul>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-common/CLIMiniCluster.html">CLI Mini Cluster</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-common/FairCallQueue.html">Fair Call Queue</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-common/NativeLibraries.html">Native Libraries</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-common/Superusers.html">Proxy User</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-common/RackAwareness.html">Rack Awareness</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-common/SecureMode.html">Secure Mode</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-common/ServiceLevelAuth.html">Service Level Authorization</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-common/HttpAuthentication.html">HTTP Authentication</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-common/CredentialProviderAPI.html">Credential Provider API</a>
</li>
<li class="none">
<a href="../../../hadoop-kms/index.html">Hadoop KMS</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-common/Tracing.html">Tracing</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-common/UnixShellGuide.html">Unix Shell Guide</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-common/registry/index.html">Registry</a>
</li>
</ul>
<h5>HDFS</h5>
<ul>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/HdfsDesign.html">Architecture</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/HdfsUserGuide.html">User Guide</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/HDFSCommands.html">Commands Reference</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/HDFSHighAvailabilityWithQJM.html">NameNode HA With QJM</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/HDFSHighAvailabilityWithNFS.html">NameNode HA With NFS</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/ObserverNameNode.html">Observer NameNode</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/Federation.html">Federation</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/ViewFs.html">ViewFs</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/ViewFsOverloadScheme.html">ViewFsOverloadScheme</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/HdfsSnapshots.html">Snapshots</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/HdfsEditsViewer.html">Edits Viewer</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/HdfsImageViewer.html">Image Viewer</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/HdfsPermissionsGuide.html">Permissions and HDFS</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/HdfsQuotaAdminGuide.html">Quotas and HDFS</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/LibHdfs.html">libhdfs (C API)</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/WebHDFS.html">WebHDFS (REST API)</a>
</li>
<li class="none">
<a href="../../../hadoop-hdfs-httpfs/index.html">HttpFS</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/ShortCircuitLocalReads.html">Short Circuit Local Reads</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/CentralizedCacheManagement.html">Centralized Cache Management</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/HdfsNfsGateway.html">NFS Gateway</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/HdfsRollingUpgrade.html">Rolling Upgrade</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/ExtendedAttributes.html">Extended Attributes</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/TransparentEncryption.html">Transparent Encryption</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/HdfsMultihoming.html">Multihoming</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/ArchivalStorage.html">Storage Policies</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/MemoryStorage.html">Memory Storage Support</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/SLGUserGuide.html">Synthetic Load Generator</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/HDFSErasureCoding.html">Erasure Coding</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/HDFSDiskbalancer.html">Disk Balancer</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/HdfsUpgradeDomain.html">Upgrade Domain</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/HdfsDataNodeAdminGuide.html">DataNode Admin</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs-rbf/HDFSRouterFederation.html">Router Federation</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/HdfsProvidedStorage.html">Provided Storage</a>
</li>
</ul>
<h5>MapReduce</h5>
<ul>
<li class="none">
<a href="../../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapReduceTutorial.html">Tutorial</a>
</li>
<li class="none">
<a href="../../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapredCommands.html">Commands Reference</a>
</li>
<li class="none">
<a href="../../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapReduce_Compatibility_Hadoop1_Hadoop2.html">Compatibility with 1.x</a>
</li>
<li class="none">
<a href="../../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/EncryptedShuffle.html">Encrypted Shuffle</a>
</li>
<li class="none">
<a href="../../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/PluggableShuffleAndPluggableSort.html">Pluggable Shuffle/Sort</a>
</li>
<li class="none">
<a href="../../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/DistributedCacheDeploy.html">Distributed Cache Deploy</a>
</li>
<li class="none">
<a href="../../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/SharedCacheSupport.html">Support for YARN Shared Cache</a>
</li>
</ul>
<h5>MapReduce REST APIs</h5>
<ul>
<li class="none">
<a href="../../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapredAppMasterRest.html">MR Application Master</a>
</li>
<li class="none">
<a href="../../../hadoop-mapreduce-client/hadoop-mapreduce-client-hs/HistoryServerRest.html">MR History Server</a>
</li>
</ul>
<h5>YARN</h5>
<ul>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/YARN.html">Architecture</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/YarnCommands.html">Commands Reference</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/CapacityScheduler.html">Capacity Scheduler</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/FairScheduler.html">Fair Scheduler</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/ResourceManagerRestart.html">ResourceManager Restart</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/ResourceManagerHA.html">ResourceManager HA</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/ResourceModel.html">Resource Model</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/NodeLabel.html">Node Labels</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/NodeAttributes.html">Node Attributes</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/WebApplicationProxy.html">Web Application Proxy</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/TimelineServer.html">Timeline Server</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/TimelineServiceV2.html">Timeline Service V.2</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/WritingYarnApplications.html">Writing YARN Applications</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/YarnApplicationSecurity.html">YARN Application Security</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/NodeManager.html">NodeManager</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/DockerContainers.html">Running Applications in Docker Containers</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/RuncContainers.html">Running Applications in runC Containers</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/NodeManagerCgroups.html">Using CGroups</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/SecureContainer.html">Secure Containers</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/ReservationSystem.html">Reservation System</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/GracefulDecommission.html">Graceful Decommission</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/OpportunisticContainers.html">Opportunistic Containers</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/Federation.html">YARN Federation</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/SharedCache.html">Shared Cache</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/UsingGpus.html">Using GPU</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/UsingFPGA.html">Using FPGA</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/PlacementConstraints.html">Placement Constraints</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/YarnUI2.html">YARN UI2</a>
</li>
</ul>
<h5>YARN REST APIs</h5>
<ul>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/WebServicesIntro.html">Introduction</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/ResourceManagerRest.html">Resource Manager</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/NodeManagerRest.html">Node Manager</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/TimelineServer.html#Timeline_Server_REST_API_v1">Timeline Server</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/TimelineServiceV2.html#Timeline_Service_v.2_REST_API">Timeline Service V.2</a>
</li>
</ul>
<h5>YARN Service</h5>
<ul>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/yarn-service/Overview.html">Overview</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/yarn-service/QuickStart.html">QuickStart</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/yarn-service/Concepts.html">Concepts</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/yarn-service/YarnServiceAPI.html">Yarn Service API</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/yarn-service/ServiceDiscovery.html">Service Discovery</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/yarn-service/SystemServices.html">System Services</a>
</li>
</ul>
<h5>Hadoop Compatible File Systems</h5>
<ul>
<li class="none">
<a href="../../../hadoop-aliyun/tools/hadoop-aliyun/index.html">Aliyun OSS</a>
</li>
<li class="none">
<a href="../../../hadoop-aws/tools/hadoop-aws/index.html">Amazon S3</a>
</li>
<li class="none">
<a href="../../../hadoop-azure/index.html">Azure Blob Storage</a>
</li>
<li class="none">
<a href="../../../hadoop-azure-datalake/index.html">Azure Data Lake Storage</a>
</li>
<li class="none">
<a href="../../../hadoop-openstack/index.html">OpenStack Swift</a>
</li>
<li class="none">
<a href="../../../hadoop-cos/cloud-storage/index.html">Tencent COS</a>
</li>
</ul>
<h5>Auth</h5>
<ul>
<li class="none">
<a href="../../../hadoop-auth/index.html">Overview</a>
</li>
<li class="none">
<a href="../../../hadoop-auth/Examples.html">Examples</a>
</li>
<li class="none">
<a href="../../../hadoop-auth/Configuration.html">Configuration</a>
</li>
<li class="none">
<a href="../../../hadoop-auth/BuildingIt.html">Building</a>
</li>
</ul>
<h5>Tools</h5>
<ul>
<li class="none">
<a href="../../../hadoop-streaming/HadoopStreaming.html">Hadoop Streaming</a>
</li>
<li class="none">
<a href="../../../hadoop-archives/HadoopArchives.html">Hadoop Archives</a>
</li>
<li class="none">
<a href="../../../hadoop-archive-logs/HadoopArchiveLogs.html">Hadoop Archive Logs</a>
</li>
<li class="none">
<a href="../../../hadoop-distcp/DistCp.html">DistCp</a>
</li>
<li class="none">
<a href="../../../hadoop-gridmix/GridMix.html">GridMix</a>
</li>
<li class="none">
<a href="../../../hadoop-rumen/Rumen.html">Rumen</a>
</li>
<li class="none">
<a href="../../../hadoop-resourceestimator/ResourceEstimator.html">Resource Estimator Service</a>
</li>
<li class="none">
<a href="../../../hadoop-sls/SchedulerLoadSimulator.html">Scheduler Load Simulator</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-common/Benchmarking.html">Hadoop Benchmarking</a>
</li>
<li class="none">
<a href="../../../hadoop-dynamometer/Dynamometer.html">Dynamometer</a>
</li>
</ul>
<h5>Reference</h5>
<ul>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-common/release/">Changelog and Release Notes</a>
</li>
<li class="none">
<a href="../../../api/index.html">Java API docs</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-common/UnixShellAPI.html">Unix Shell API</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-common/Metrics.html">Metrics</a>
</li>
</ul>
<h5>Configuration</h5>
<ul>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-common/core-default.xml">core-default.xml</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/hdfs-default.xml">hdfs-default.xml</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs-rbf/hdfs-rbf-default.xml">hdfs-rbf-default.xml</a>
</li>
<li class="none">
<a href="../../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/mapred-default.xml">mapred-default.xml</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-common/yarn-default.xml">yarn-default.xml</a>
</li>
<li class="none">
<a href="../../../hadoop-kms/kms-default.html">kms-default.xml</a>
</li>
<li class="none">
<a href="../../../hadoop-hdfs-httpfs/httpfs-default.html">httpfs-default.xml</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-common/DeprecatedProperties.html">Deprecated Properties</a>
</li>
</ul>
<a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
<img alt="Built by Maven" src="../images/logos/maven-feather.png"/>
</a>
</div>
</div>
<div id="bodyColumn">
<div id="contentBox">
<!---
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. See accompanying LICENSE file.
-->
<h1>YARN Service Examples</h1>
<p>This document describes some example service definitions (<tt>Yarnfile</tt>).</p>
<ul>
<li><a href="#Apache_web_server_-_httpd_.28with_registry_DNS.29">Apache web server - httpd (with registry DNS)</a></li>
<li><a href="#Apache_web_server_-_httpd_.28without_registry_DNS.29">Apache web server - httpd (without registry DNS)</a></li>
<li><a href="#Application_Catalog_-_appcatalog">Application Catalog - appcatalog</a></li>
<li><a href="#Docker_image_ENTRYPOINT_support">Docker image ENTRYPOINT support</a></li></ul>
<div class="section">
<h2><a name="Apache_web_server_-_httpd_.28with_registry_DNS.29"></a>Apache web server - httpd (with registry DNS)</h2>
<p>For this example to work, centos/httpd-24-centos7 image must be included in <tt>docker.trusted.registries</tt>. For server side configuration, please refer to <a href="../DockerContainers.html">Running Applications in Docker Containers</a> document.</p>
<p>Below is the <tt>Yarnfile</tt> for a service called <tt>httpd-service</tt> with two <tt>httpd</tt> instances. There is also an httpd proxy instance (httpd-proxy-0) that proxies between the other two httpd instances (httpd-0 and httpd-1).</p>
<p>Note this example requires registry DNS.</p>
<div>
<div>
<pre class="source">{
&quot;name&quot;: &quot;httpd-service&quot;,
&quot;version&quot;: &quot;1.0&quot;,
&quot;lifetime&quot;: &quot;3600&quot;,
&quot;components&quot;: [
{
&quot;name&quot;: &quot;httpd&quot;,
&quot;number_of_containers&quot;: 2,
&quot;artifact&quot;: {
&quot;id&quot;: &quot;centos/httpd-24-centos7:latest&quot;,
&quot;type&quot;: &quot;DOCKER&quot;
},
&quot;launch_command&quot;: &quot;/usr/bin/run-httpd&quot;,
&quot;resource&quot;: {
&quot;cpus&quot;: 1,
&quot;memory&quot;: &quot;1024&quot;
},
&quot;configuration&quot;: {
&quot;files&quot;: [
{
&quot;type&quot;: &quot;TEMPLATE&quot;,
&quot;dest_file&quot;: &quot;/var/www/html/index.html&quot;,
&quot;properties&quot;: {
&quot;content&quot;: &quot;&lt;html&gt;&lt;header&gt;&lt;title&gt;Title&lt;/title&gt;&lt;/header&gt;&lt;body&gt;Hello from ${COMPONENT_INSTANCE_NAME}!&lt;/body&gt;&lt;/html&gt;&quot;
}
}
]
}
},
{
&quot;name&quot;: &quot;httpd-proxy&quot;,
&quot;number_of_containers&quot;: 1,
&quot;artifact&quot;: {
&quot;id&quot;: &quot;centos/httpd-24-centos7:latest&quot;,
&quot;type&quot;: &quot;DOCKER&quot;
},
&quot;launch_command&quot;: &quot;/usr/bin/run-httpd&quot;,
&quot;resource&quot;: {
&quot;cpus&quot;: 1,
&quot;memory&quot;: &quot;1024&quot;
},
&quot;configuration&quot;: {
&quot;files&quot;: [
{
&quot;type&quot;: &quot;TEMPLATE&quot;,
&quot;dest_file&quot;: &quot;/etc/httpd/conf.d/httpd-proxy.conf&quot;,
&quot;src_file&quot;: &quot;httpd-proxy.conf&quot;
}
]
}
}
],
&quot;quicklinks&quot;: {
&quot;Apache HTTP Server&quot;: &quot;http://httpd-proxy-0.${SERVICE_NAME}.${USER}.${DOMAIN}:8080&quot;
}
}
</pre></div></div>
<p>This <tt>Yarnfile</tt> is already included in the Hadoop distribution, along with the required configuration template <tt>httpd-proxy.conf</tt>. First upload the configuration template file to HDFS:</p>
<div>
<div>
<pre class="source">hdfs dfs -copyFromLocal ${HADOOP_YARN_HOME}/share/hadoop/yarn/yarn-service-examples/httpd/httpd-proxy.conf .
</pre></div></div>
<p>The proxy configuration template looks like the following and will configure the httpd-proxy-0 container to balance between the httpd-0 and httpd-1 containers evenly:</p>
<div>
<div>
<pre class="source">&lt;Proxy balancer://test&gt;
BalancerMember http://httpd-0.${SERVICE_NAME}.${USER}.${DOMAIN}:8080
BalancerMember http://httpd-1.${SERVICE_NAME}.${USER}.${DOMAIN}:8080
ProxySet lbmethod=bytraffic
&lt;/Proxy&gt;
ProxyPass &quot;/&quot; &quot;balancer://test/&quot;
ProxyPassReverse &quot;/&quot; &quot;balancer://test/&quot;
</pre></div></div>
<p>Then run the service with the command:</p>
<div>
<div>
<pre class="source">yarn app -launch &lt;service-name&gt; httpd
</pre></div></div>
<p>The last argument is either the path to a JSON specification of the service, or in this case, the name of an example service. The directory where examples can be found can be configured by setting the YARN_EXAMPLES_DIR environment variable.</p>
<p>Once the service is running, navigate to <tt>http://httpd-proxy-0.${SERVICE_NAME}.${USER}.${DOMAIN}:8080</tt> to see the root page. The pages should alternately show &#x201c;Hello from httpd-0!&#x201d; or &#x201c;Hello from httpd-1!&#x201d;</p>
<p>The individual httpd URLs can also be visited, <tt>http://httpd-0.${SERVICE_NAME}.${USER}.${DOMAIN}:8080</tt> and <tt>http://httpd-1.${SERVICE_NAME}.${USER}.${DOMAIN}:8080</tt>.</p>
<p>If unsure of your hostnames, visit the RM REST endpoint <tt>http://&lt;RM host&gt;:8088/app/v1/services/httpd-service</tt>.</p></div>
<div class="section">
<h2><a name="Apache_web_server_-_httpd_.28without_registry_DNS.29"></a>Apache web server - httpd (without registry DNS)</h2>
<p>A similar IP-based example is provided for environments that do not have registry DNS set up. The service name for this example is <tt>httpd-service-no-dns</tt>. There are a couple of additions to the <tt>Yarnfile</tt> for the <tt>httpd-service</tt> described above. A readiness check is added for the <tt>httpd</tt> component:</p>
<div>
<div>
<pre class="source"> &quot;readiness_check&quot;: {
&quot;type&quot;: &quot;HTTP&quot;,
&quot;properties&quot;: {
&quot;url&quot;: &quot;http://${THIS_HOST}:8080&quot;
}
},
</pre></div></div>
<p>and <tt>httpd</tt> is added as a dependency for the <tt>httpd-proxy</tt> component:</p>
<div>
<div>
<pre class="source"> &quot;dependencies&quot;: [ &quot;httpd&quot; ],
</pre></div></div>
<p>This means that the httpd-proxy-0 instance will not be started until after an HTTP probe has succeeded for the httpd-0 and httpd-1 containers. This is necessary so that the IPs of the containers can be used in the configuration of httpd-proxy-0. The proxy configuration is similar to that of the previous example, with the BalancerMember lines changed as follows:</p>
<div>
<div>
<pre class="source"> BalancerMember http://${HTTPD-0_IP}:8080
BalancerMember http://${HTTPD-1_IP}:8080
</pre></div></div>
<p>Note that IP and HOST variables such as <tt>${HTTPD-0_IP}</tt> and <tt>${HTTPD-0_HOST}</tt> should only be used by a component that has a dependency on the named component (<tt>httpd</tt> in this case) AND should only be used when the named component specifies a readiness check. Here, <tt>httpd-proxy</tt> has a dependency on <tt>httpd</tt> and <tt>httpd</tt> has an HTTP readiness check. Without the dependency and readiness check, the httpd-proxy-0 container would be started in parallel with the httpd-0 and http-1 containers, and the IPs and hosts would not be assigned yet for httpd-0 and httpd-1.</p>
<p>Other variables can be used by any component.</p>
<p>Before creating the service, upload the proxy configuration to HDFS:</p>
<div>
<div>
<pre class="source">hdfs dfs -copyFromLocal ${HADOOP_YARN_HOME}/share/hadoop/yarn/yarn-service-examples/httpd-no-dns/httpd-proxy-no-dns.conf .
</pre></div></div>
<p>Then run the service with the command:</p>
<div>
<div>
<pre class="source">yarn app -launch &lt;service-name&gt; httpd-no-dns
</pre></div></div>
<p>where <tt>service-name</tt> is optional. If omitted, it uses the name defined in the <tt>Yarnfile</tt>.</p>
<p>Look up your IPs at the RM REST endpoint <tt>http://&lt;RM host&gt;:8088/app/v1/services/httpd-service</tt>. Then visit port 8080 for each IP to view the pages.</p></div>
<div class="section">
<h2><a name="Application_Catalog_-_appcatalog"></a>Application Catalog - appcatalog</h2>
<p>Application Catalog introduces many exciting new features for deploying Hadoop software that benefit both administrators and end users. With Application Catalog, user gets a personalized view of the software status in Hadoop. In addition, users can install or register applications by using web-based user interface.</p>
<p>To start Application Catalog service with the command:</p>
<div>
<div>
<pre class="source">yarn app -launch &lt;service-name&gt; appcatalog
</pre></div></div>
<p>where <tt>service-name</tt> is user defined name.</p>
<p>The deployment progress of the application catalog is located in Resource Manager UI. When the service reaches STABLE state, application catalog UI is available at: <a class="externalLink" href="http://appcatalog.${SERVICE_NAME}.${USER}.${DOMAIN}:8080/">http://appcatalog.${SERVICE_NAME}.${USER}.${DOMAIN}:8080/</a></p>
<p>For secure cluster, Kerberos settings for application catalog can be configured in Yarn service JSON using environment variable settings:</p>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Environment Variable </th>
<th align="left"> Example </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> YARN_CONTAINER_RUNTIME_DOCKER_MOUNTS </td>
<td align="left"> /etc/hadoop/conf:/etc/hadoop/conf:ro,/etc/krb5.conf:/etc/krb5.conf:ro,/etc/security/keytabs/yarn.service.keytab:/etc/security/keytabs/yarn.service.keytab:ro,/etc/security/keytabs/spnego.service.keytab:/etc/security/keytabs/spnego.service.keytab:ro </td>
<td align="left"> Container mount path for Hadoop configuration, Kerberos krb5.conf, and list of Kerberos keytab files. </td></tr>
<tr class="a">
<td align="left"> SPNEGO_KEYTAB </td>
<td align="left"> /etc/security/keytabs/spnego.service.keytab </td>
<td align="left"> Service principal for Application catalog. </td></tr>
<tr class="b">
<td align="left"> SPNEGO_PRINCIPAL </td>
<td align="left"> <a class="externalLink" href="mailto:HTTP/appcatalog.catalog.yarn.example.com@EXAMPLE.COM">HTTP/appcatalog.catalog.yarn.example.com@EXAMPLE.COM</a> </td>
<td align="left"> Service principal for Application catalog. </td></tr>
<tr class="a">
<td align="left"> KEYTAB </td>
<td align="left"> /etc/security/keytabs/yarn.service.ketab </td>
<td align="left"> Path to keytab file, used by YARN service application master. </td></tr>
<tr class="b">
<td align="left"> PRINCIPAL </td>
<td align="left"> <a class="externalLink" href="mailto:yarn/_HOST@EXAMPLE.COM">yarn/_HOST@EXAMPLE.COM</a> </td>
<td align="left"> Service principal used by YARN service application master. </td></tr>
</tbody>
</table>
<p>Application Catalog environment options:</p>
<p>| Environment variables | Description | | KEYTAB | Service user keytab file for accessing HDFS. | | PRINCIPAL | Service user Kerboers principal. | | SOLR_DATA_DIR | Location to store Solr data. | | SOLR_STORAGE_TYPE | Storage type for Solr data, supported type are: hdfs, local | | SPNEGO_KEYTAB | Location of the keytab file used for authenticating HTTP endpoint. | | SPNEGO_PRINCIPAL | The Kerberos principal to be used for HTTP endpoint. The principal MUST start with &#x2018;HTTP&#x2019;/ as per Kerberos HTTP SPNEGO specification. |</p>
<p>Secure application catalog Yarnfile example:</p>
<div>
<div>
<pre class="source">{
&quot;name&quot;: &quot;catalog&quot;,
&quot;kerberos_principal&quot; : {
&quot;principal_name&quot; : &quot;catalog/_HOST@EXAMPLE.COM&quot;,
&quot;keytab&quot; : &quot;file:///etc/security/keytabs/catalog.service.keytab&quot;
},
&quot;version&quot;: &quot;1&quot;,
&quot;components&quot; :
[
{
&quot;name&quot;: &quot;appcatalog&quot;,
&quot;number_of_containers&quot;: 1,
&quot;artifact&quot;: {
&quot;id&quot;: &quot;apache/hadoop-yarn-applications-catalog-docker:3.3.0-SNAPSHOT&quot;,
&quot;type&quot;: &quot;DOCKER&quot;
},
&quot;resource&quot;: {
&quot;cpus&quot;: 1,
&quot;memory&quot;: &quot;256&quot;
},
&quot;configuration&quot;: {
&quot;env&quot;: {
&quot;YARN_CONTAINER_RUNTIME_DOCKER_RUN_OVERRIDE_DISABLE&quot;:&quot;true&quot;,
&quot;YARN_CONTAINER_RUNTIME_DOCKER_MOUNTS&quot;:&quot;/etc/hadoop/conf:/etc/hadoop/conf:ro,/etc/krb5.conf:/etc/krb5.conf:ro,/etc/security/keytabs/catalog.service.keytab:/etc/security/keytabs/hbase.service.keytab:ro,/etc/security/keytabs/spnego.service.keytab:/etc/security/keytabs/spnego.service.keytab:ro&quot;,
&quot;SPNEGO_KEYTAB&quot;:&quot;/etc/security/keytabs/spnego.service.keytab&quot;,
&quot;SPNEGO_PRINCIPAL&quot;:&quot;HTTP/host-3.example.com@EXAMPLE.COM&quot;,
&quot;KEYTAB&quot;:&quot;/etc/security/keytabs/catalog.service.keytab&quot;,
&quot;PRINCIPAL&quot;:&quot;catalog/host3.example.com@EXAMPLE.COM&quot;,
&quot;SOLR_DATA_DIR&quot;:&quot;hdfs://host-1.example.com:9000/tmp/solr&quot;,
&quot;SOLR_UPDATE_LOG&quot;:&quot;hdfs://host-1.example.com:9000/tmp/solr&quot;,
&quot;SOLR_STORAGE_TYPE&quot;:&quot;hdfs&quot;
},
&quot;properties&quot;: {
&quot;docker.network&quot;: &quot;host&quot;
}
}
}
]
}
</pre></div></div>
</div>
<div class="section">
<h2><a name="Docker_image_ENTRYPOINT_support"></a>Docker image ENTRYPOINT support</h2>
<p>Docker images may have built with ENTRYPOINT to enable start up of docker image without any parameters. When passing parameters to ENTRYPOINT enabled image, <tt>launch_command</tt> is delimited by comma (,).</p>
<div>
<div>
<pre class="source">{
&quot;name&quot;: &quot;sleeper-service&quot;,
&quot;version&quot;: &quot;1.0&quot;,
&quot;components&quot; :
[
{
&quot;name&quot;: &quot;sleeper&quot;,
&quot;number_of_containers&quot;: 2,
&quot;artifact&quot;: {
&quot;id&quot;: &quot;hadoop/centos:latest&quot;,
&quot;type&quot;: &quot;DOCKER&quot;
},
&quot;launch_command&quot;: &quot;sleep,90000&quot;,
&quot;resource&quot;: {
&quot;cpus&quot;: 1,
&quot;memory&quot;: &quot;256&quot;
},
&quot;restart_policy&quot;: &quot;ON_FAILURE&quot;,
&quot;configuration&quot;: {
&quot;env&quot;: {
&quot;YARN_CONTAINER_RUNTIME_DOCKER_RUN_OVERRIDE_DISABLE&quot;:&quot;true&quot;
},
&quot;properties&quot;: {
&quot;docker.network&quot;: &quot;host&quot;
}
}
}
]
}
</pre></div></div></div>
</div>
</div>
<div class="clear">
<hr/>
</div>
<div id="footer">
<div class="xright">
&#169; 2008-2021
Apache Software Foundation
- <a href="http://maven.apache.org/privacy-policy.html">Privacy Policy</a>.
Apache Maven, Maven, Apache, the Apache feather logo, and the Apache Maven project logos are trademarks of The Apache Software Foundation.
</div>
<div class="clear">
<hr/>
</div>
</div>
</body>
</html>