Updated on 2022-08-16 GMT+08:00

Submitting a Topology When a Client Is Installed on a Linux OS

Scenario

You can use storm commands to submit topologies in a Linux environment.

Prerequisites

  • You have installed the Storm client.
  • If the host where the client is installed is not a node in the cluster, set the mapping between the host name and the IP address in the hostsfile on the node where the client locates. The host name and IP address must be in one-to-one mapping.
  • Packaging Services has been performed and source.jar has been generated.

Procedure

  1. In security mode, perform security authentication first.

    1. Initialize client environment variables.

      Go to the installation directory /opt/Storm_client, and run the following command to import environment variables:

      source bigdata_env

    2. Use the developer account created in Preparing the Developer Account section for secure login.

      Run the kinit command to log in with security mode as a human-machine user.

      kinit Username

      For example, run the following command:

      kinit developuser

      Enter a password as prompted. If no error message appears, the Kerberos authentication is completed for the user.

  2. Submit a topology. (Wordcount is used as an example. For details about other topologies, see related development guide.) Go to the Storm/storm-1.2.1/bin directory on the Streaming client, and run the storm jar /opt/jartarget/source.jar com.huawei.storm.example.wordcount.WordCountTopology command to submit the generated source.jar package. (If the package is generated on a Windows OS, upload the source.jar package to a specified directory on the Linux server, such as /opt/jartarget.)
  3. Run the storm list command to view the submitted applications. If the word-count application can be viewed, the task is submitted successfully.

    If a service is set to the local mode and is submitted by using commands, ensure that the submitting environment is a normal one. Currently, services in local mode cannot be submitted by using commands in a security environment.