6.2. Configuring Storm on YARN

Accessing the Storm Configuration Files

The Storm application package includes default application and resource specification files. The package includes both non-secure (appConfig-default.json) and secure (appConfig-secured-default.json) versions of the application specification. You can save these files as a another name, and then edit the files to customize the Storm configuration.

You can use the unzip command to extract the Storm application and resource specification files from the Storm-on-Slider application package. For example, you would use the following command to extract the files from the Storm application package in the /usr/work/app-packages/storm directory:

unzip /usr/work/app-packages/storm/slider-storm-app-package-0.9.3.2.2.0.0-2041.zip appConfig-default.json -d /usr/work/app-packages/storm
unzip /usr/work/app-packages/storm/slider-storm-app-package-0.9.3.2.2.0.0-2041.zip resources-default.json -d /usr/work/app-packages/storm

You can use the following commands to copy and rename the default Storm application and resource specification files in the /usr/work/app-packages/storm directory:

cp /usr/work/app-packages/storm/appConfig-default.json /usr/work/app-packages/storm/appConfig.json
cp /usr/work/app-packages/storm/resources-default.json /usr/work/app-packages/storm/resources.json

Application Configuration for Storm on YARN

The basic properties to adjust are the heapsize parameters for Storm daemons such as nimbus, supervisor, UI, and worker childopts to fit your system. Memory considerations are discussed in the "Deployment Considerations" section of this guide.

The following is an example of a Storm appConfig.json file:

{ "schema": "http://example.org/specification/v2.0.0",
   "metadata": {
 },
"global": {
 "application.def": ".slider/package/STORM/slider-storm-app-package-0.9.3.2.2.0.0-2041.zip",
 "java_home": "/usr/jdk64/jdk1.7.0_67",
 "create.default.zookeeper.node": "true",
 "system_configs": "core-site",
 "site.global.app_user": "yarn",
 "site.global.app_root": "${AGENT_WORK_ROOT}/app/install/apache-storm-0.9.3.2.2.0.0-2041",
 "site.global.user_group": "hadoop",
 "site.global.ganglia_server_host": "${NN_HOST}",
 "site.global.ganglia_server_id": "Application2",
 "site.global.ganglia_enabled":"true",
 "site.global.ganglia_server_port": "8668",

 "site.storm-site.storm.log.dir" : "${AGENT_LOG_ROOT}",
 "site.storm-site.storm.zookeeper.servers": "['${ZK_HOST}']",
 "site.storm-site.nimbus.thrift.port": "${NIMBUS.ALLOCATED_PORT}",
 "site.storm-site.storm.local.dir": "${AGENT_WORK_ROOT}/app/tmp/storm",
 "site.storm-site.transactional.zookeeper.root": "/transactional",
 "site.storm-site.storm.zookeeper.port": "2181",
 "site.storm-site.nimbus.childopts": "-Xmx1024m -javaagent:${AGENT_WORK_ROOT}/app/install/apache-storm-0.9.3.2.2.0.0-2041/external/storm-jmxetric/lib/jmxetric-1.0.4.jar=host=${@//site/global/ganglia_server_host},port=${@//site/global/ganglia_server_port},wireformat31x=true,mode=multicast,config=${AGENT_WORK_ROOT}/app/install/apache-storm-0.9.3.2.2.0.0-908/external/storm-jmxetric/conf/jmxetric-conf.xml,process=Nimbus_JVM",
 "site.storm-site.worker.childopts": "-Xmx768m -javaagent:${AGENT_WORK_ROOT}/app/install/apache-storm-0.9.3.2.2.0.0-2041/external/storm-jmxetric/lib/jmxetric-1.0.4.jar=host=${@//site/global/ganglia_server_host},port=${@//site/global/ganglia_server_port},wireformat31x=true,mode=multicast,config=${AGENT_WORK_ROOT}/app/install/apache-storm-0.9.3.2.2.0.0-908/external/storm-jmxetric/conf/jmxetric-conf.xml,process=Worker_%ID%_JVM",
 "site.storm-site.dev.zookeeper.path": "${AGENT_WORK_ROOT}/app/tmp/dev-storm-zookeeper",
 "site.storm-site.drpc.invocations.port": "0",
 "site.storm-site.storm.zookeeper.root": "${DEFAULT_ZK_PATH}",
 "site.storm-site.transactional.zookeeper.port": "null",
 "site.storm-site.nimbus.host": "${NIMBUS_HOST}",
 "site.storm-site.ui.port": "${STORM_UI_SERVER.ALLOCATED_PORT}",
 "site.storm-site.supervisor.slots.ports": "[${SUPERVISOR.ALLOCATED_PORT}{PER_CONTAINER},${SUPERVISOR.ALLOCATED_PORT}{PER_CONTAINER}]",
 "site.storm-site.supervisor.childopts": "-Xmx256m -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.port=0 -javaagent:${AGENT_WORK_ROOT}/app/install/apache-storm-0.9.3.2.2.0.0-2041/external/storm-jmxetric/lib/jmxetric-1.0.4.jar=host=${NN_HOST},port=8668,wireformat31x=true,mode=multicast,config=${AGENT_WORK_ROOT}/app/install/apache-storm-0.9.3.2.2.0.0-908/external/storm-jmxetric/conf/jmxetric-conf.xml,process=Supervisor_JVM",
 "site.storm-site.drpc.port": "0",
 "site.storm-site.logviewer.port": "${SUPERVISOR.ALLOCATED_PORT}{PER_CONTAINER}"
 },
 "components": {
   "slider-appmaster": {
   "jvm.heapsize": "256M"
   }
  }
 }
[Note]Note

The user name for the site.global.app_user property should be the user name you will use to launch the Storm application instance.

Resource Components in Storm on YARN

You can specify the following components (also referred to as "roles") when deploying Storm on YARN via Slider:

  • NIMBUS ⎯ Storm Nimbus process.

  • STORM_UI_SERVER ⎯ Storm Web UI process.

  • DRPC_SERVER ⎯ Storm DRPC Server.

  • SUPERVISOR ⎯ Storm Supervisor process.

The following is an example of a Storm resources.json file with these roles configured:

{
"schema" : "http://example.org/specification/v2.0.0",
"metadata" : {
 },
"global" : {
  "yarn.log.include.patterns": "",
  "yarn.log.exclude.patterns": "",
  "yarn.log.interval": "0"
 },
 "components": {
   "slider-appmaster": {
    },
   "NIMBUS": {
     "yarn.role.priority": "1",
     "yarn.component.instances": "1",
     "yarn.memory": "2048",
     "yarn.label.expression":"storm1_nimbus_label"
    },
    "STORM_UI_SERVER": {
    "yarn.role.priority": "2",
    "yarn.component.instances": "1",
    "yarn.memory": "1278",
    "yarn.label.expression":"storm1_nimbus_label"
    },
    "DRPC_SERVER": {
      "yarn.role.priority": "3",
      "yarn.component.instances": "1",
      "yarn.memory": "1278",
     “"yarn.label.expression":"storm1_nimbus_label"
    },
   "SUPERVISOR": {
    "yarn.role.priority": "4",
    "yarn.component.instances": "1",
    "yarn.memory": "3072",
    "yarn.label.expression":"storm1_supervisor_label"
    }
   }
 }

The memory and number of instances of SUPERVISOR should be adjusted for your system and desired application instance size. By default SUPERVISOR has two worker ports. If you allocate more workers per SUPERVISOR you should also adjust the yarn.memory vaule in the SUPERVISOR section of the resources.json file.

For all of the other roles (NIMBUS, DRPC_SERVER, STORM_UI_SERVER), you should configure only one instance.


loading table of contents...