• MapReduce Service

mrs
  1. Help Center
  2. MapReduce Service
  3. User Guide
  4. Using MRS
  5. Using Storm
  6. Submitting Storm Topologies on the Client

Submitting Storm Topologies on the Client

Scenario

Users can submit Storm topologies on the MRS cluster client to continuously process stream data. For clusters with Kerberos authentication enabled, users who submit topologies must be members of the stormadmin or storm group.

Prerequisites

The client has been updated.

Procedure

  1. Log in to the node where the client is installed.

    For example, if you have updated the client on the Master2 node, log in to the Master2 node to use the client. For details, see Client Management.

  2. Run the following command to switch the user:

    sudo su - omm

  3. Run the following command to switch to the client directory, for example, /opt/client:

    cd /opt/client

  4. Run the following command to configure the environment variables:

    source bigdata_env

  5. If Kerberos authentication is enabled, run the following command to authenticate the user. If Kerberos authentication is disabled, skip this step.

    kinit Storm username

    For example, kinit admin

  6. Run the following command to submit the Storm topology:

    storm jar Topology package path Class name of the main topology method Topology name

    Example:

    storm jar /opt/client/Storm/storm-1.0.2/examples/storm-starter/storm-starter-topologies-1.0.2.jar org.apache.storm.starter.WordCountTopology topo1

    If the following information is displayed, the topology is submitted successfully.

    Finished submitting topology: topo1
    NOTE:
    • To support sampling messages, add the topology.debug and topology.eventlogger.executors parameters. For example:

      storm jar /opt/client/Storm/storm-1.0.2/examples/storm-starter/storm-starter-topologies-1.0.2.jar org.apache.storm.starter.WordCountTopology topo1 -c topology.debug=true -c topology.eventlogger.executors=1

    • Data processing methods vary with topologies. The topology in the example generates characters randomly and separates character strings. To query the processing status, enable the sampling function and perform operations according to Querying Data Processing Logs of the Topology.

  7. Run the following command to query Storm topologies. For clusters with Kerberos authentication enabled, only users in the stormadmin or storm group can query all topologies.

    storm list