Application Definition

App definition is a declarative definition of a YARN application describing its content. The AppDefinition is used in conjunction with the AppPackage. Application definition is an XML file and is packaged as metainfo.xml.

Structure

Non-mandatory fields are described in italics.

The fields to describe an application is as follows:

  • name: the name of the application

  • version: the version of the application. name and version together uniquely identify an application.

  • type: the type of the application. “YARN-APP” identifies an application definition suitable for YARN.

  • minHadoopVersion: the minimum version of hadoop on which the app can run

  • components: the list of component that the application is comprised of

  • osSpecifics: OS specific package information for the application

  • commandScript: application wide commands may also be defined. The command is executed on a component instance that is a client

  • dependencies: application can define a list of dependencies. Dependencies can be on the base services such as HDFS, ZOOKEEPER, YARN which are infrastructure services or GANGLIA, NAGIOS, etc. which are monitoring/alert services. The dependencies are parsed by the management infrastructure to provide the necessary configurations to allow the app to access the services. For example, a HDFS folder could be requested by the app to store its data, a ZOOKEEPER node to co-ordinate among components.

An application contains several component. The fields associated with a component are:

  • name: name of the component

  • category: type of the component - MASTER, SLAVE, and CLIENT

  • minInstanceCount: the minimum number of instances required for this component

  • maxInstanceCount: maximum number of instances allowed for a component

  • commandScript: the script that implements the commands.

  • script: the script location - relative to the AppPackage root

  • scriptType: type of the script

  • timeout: default timeout of the script

  • customCommands: any additional commands available for the component and their implementation

An application definition also includes the package used to install the application. Its typically a tarball or some other form of package that does not require root access to install. The details of what happens during install is captured in the command script.

  • osSpecific: details on a per OS basis

  • osType: “any” refers to any OS ~ typical for tarballs

  • packages: list of packages that needs to be deployed

  • type: type of package

  • name: name of the package

  • location: location of the package (can be a relative folder within the parent AppPackage)

Application can define a an order of activation which dictates if some component activation must follow the successful activation of other components.

  • command: specifies the component and the command in the form component-command currently, START is the only valid command

  • requires: specifies component and their state that the command depends on, provided in the form component-state currently, STARTED is the only valid state

Applications can also advertise a set of properties (typically urls) that can only be bound when the application components are active. One such item can be the jmx endpoint. The properties to be advertised are organized as export groups (exportGroup) and each group can export one or more properties organized as a property bag. These values are visible through the registry service.

  • name: specifies the name of the export group

Each exportGroup contains one or more exports.

  • name: the name of the export

  • value: the template that will be populated by Slider and then exported

    <metainfo>
      <schemaVersion>2.0</schemaVersion>
      <application>
        <name>HBASE</name>
        <version>0.96.0.2.1.1</version>
        <type>YARN-APP</type>
        <minHadoopVersion>2.1.0</minHadoopVersion>
        <components>
          <component>
            <name>HBASE_MASTER</name>
            <category>MASTER</category>
            <minInstanceCount>1</minInstanceCount>
            <maxInstanceCount>2</maxInstanceCount>
            <commandScript>
              <script>scripts/hbase_master.py</script>
              <scriptType>PYTHON</scriptType>
              <timeout>600</timeout>
            </commandScript>
            <customCommands>
              <customCommand>
                <name>GRACEFUL_STOP</name>
                <commandScript>
                  <script>scripts/hbase_master.py</script>
                  <scriptType>PYTHON</scriptType>
                  <timeout>1800</timeout>
                </commandScript>
            </customCommand>
          </customCommands>
          </component>
    
          <component>
            <name>HBASE_REGIONSERVER</name>
            <category>SLAVE</category>
            <minInstanceCount>1</minInstanceCount>
            ...
          </component>
    
          <component>
            <name>HBASE_CLIENT</name>
            <category>CLIENT</category>
            ...
        </components>
    
        <osSpecifics>
          <osSpecific>
            <osType>any</osType>
            <packages>
              <package>
                <type>tarball</type>
                <name>hbase-0.96.1-tar.gz</name>
                <location>package/files</location>
              </package>
            </packages>
          </osSpecific>
        </osSpecifics>
    
        <commandOrders>
          <commandOrder>
            <command>HBASE_REGIONSERVER-START</command>
            <requires>HBASE_MASTER-STARTED</requires>
          </commandOrder>
        </commandOrders>
    
        <exportGroups>
          <exportGroup>
            <name>QuickLinks</name>
              <exports>
                <export>
                  <name>JMX_Endpoint</name>
                  <value>http://${HBASE_MASTER_HOST}:${site.hbase-site.hbase.master.info.port}/jmx</value>
                </export>
                <export>
                  <name>Master_Status</name>
                  <value>http://${HBASE_MASTER_HOST}:${site.hbase-site.hbase.master.info.port}/master-status</value>
                </export>
             </exports>
          </exportGroup>
        </exportGroups>
    
        <commandScript>
          <script>scripts/app_health_check.py</script>
          <scriptType>PYTHON</scriptType>
          <timeout>300</timeout>
        </commandScript>
    
      </application>
    </metainfo>