Slider AppPackages are a declarative definition of an application for application management. AppPackage is not a packaging scheme for application binaries and artifacts. Tarball, zip files, rpms etc. are available for that purpose. Instead AppPackage includes the application binaries along with other artifacts necessary for application management.
An application instance consists of several active component such as one or more masters and several slaves. There may be a number of accompanying processes in addition to the basic master/slave processes - lets refer to all processes as app component instances. When run in the context of Yarn, the application specific processes are activated within individual Yarn Container. If you pry into an Yarn container (created through Slider) it will be apparent as to what is the role of Slider-Agent and the actual application components. The following image provides an high-level view. Within a container there are at least two processes - and instance of a slider agent and an instance of an application component. The application can itself spawn more procsses if needed.
Figure 1 - High-level view of a container
For example:
Shows three processes, the Slider-Agent process, the bash script to start HBase Region Server and the HBase Region server itself. Three of these together constitute the container.
The following command creates an HBase application using the AppPackage for HBase.
"./slider create cl1 --zkhosts zk1,zk2 --image hdfs://NN:8020/slider/agent/slider-agent-0.21.tar --option agent.conf hdfs://NN:8020/slider/agent/conf/agent.ini --template /work/appConf.json --resources /work/resources.json --option application.def hdfs://NN:8020/slider/hbase_v096.tar"
Lets analyze various parameters from the perspective of app creation:
The structure of an AppPackage is described at AppPackage.
In the enlistment there are three example AppPackages
The application tarball, containing the binaries/artifacts of the application itself is a component within the AppPackage. They are:
They are placehoder files, mostly because the files themselves are too large as well as users are free to use their own version of the package. To create a Slider AppPackage - replace the file with an actual application tarball and then ensure that the metainfo.xml has the correct file name. After that create a tarball using standard tar commands and ensure that the package has the metainfo.xml file at the root folder.
An appConf.json contains the application configuration. The sample below shows configuration for HBase.
{ "schema" : "http://example.org/specification/v2.0.0", "metadata" : { }, "global" : { "config_types": "core-site,hdfs-site,hbase-site", "java_home": "/usr/jdk64/jdk1.7.0_45", "package_list": "files/hbase-0.96.1-hadoop2-bin.tar", "site.global.app_user": "yarn", "site.global.app_log_dir": "${AGENT_LOG_ROOT}/app/log", "site.global.app_pid_dir": "${AGENT_WORK_ROOT}/app/run", "site.global.security_enabled": "false", "site.hbase-site.hbase.hstore.flush.retries.number": "120", "site.hbase-site.hbase.client.keyvalue.maxsize": "10485760", "site.hbase-site.hbase.hstore.compactionThreshold": "3", "site.hbase-site.hbase.rootdir": "${NN_URI}/apps/hbase/data", "site.hbase-site.hbase.tmp.dir": "${AGENT_WORK_ROOT}/work/app/tmp", "site.hbase-site.hbase.regionserver.port": "0", "site.core-site.fs.defaultFS": "${NN_URI}", "site.hdfs-site.dfs.namenode.https-address": "${NN_HOST}:50470", "site.hdfs-site.dfs.namenode.http-address": "${NN_HOST}:50070" } }
appConf.jso allows you to pass in arbitrary set of configuration that Slider will forward to the application component instances.
The resources.json file encodes the Yarn resource count requirement for the application instance.
The components section lists the two application component for an HBase application.
Sample:
{ "schema" : "http://example.org/specification/v2.0.0", "metadata" : { }, "global" : { }, "components" : { "HBASE_MASTER" : { "wait.heartbeat" : "5", "role.priority" : "1", "component.instances" : "1", "role.script" : "scripts/hbase_master.py" }, "slider-appmaster" : { "jvm.heapsize" : "256M" }, "HBASE_REGIONSERVER" : { "wait.heartbeat" : "3", "role.priority" : "2", "component.instances" : "1", "role.script" : "scripts/hbase_regionserver.py" } } }
Refer to App Command Scripts for details on how to write scripts for a AppPackage. These scripts are in the package/script folder within the AppPackage. Use the checked in samples for HBase/Storm/Accumulo as reference for script development.