Spark Streaming job configuration

Updated at:

You can configure a Spark Streaming job to process streaming data in an E-MapReduce (EMR) on ECS cluster.

Prerequisites

  • A project is created. For more information, see Manage projects.
  • The resources and data required for the job are prepared.

Procedure

  1. Go to the Projects page in Data Platform.

    1. Log in to the E-MapReduce console with your Alibaba Cloud account.

    2. In the top navigation bar, select the region and resource group.

    3. Click the Data Development tab.

  2. In the row of the project you want to edit, click Edit Job.

  3. Create a Spark Streaming job.
    1. On the left side of the page, right-click the target folder and select Create Job.
    2. In the Create Job dialog box, enter a Job Name and Description, and for Job Type, select Spark Streaming.
    3. Click OK.
  4. Configure the job content.
    1. In the Content field, enter the required command-line parameters.
      A Spark Streaming job submission command has the following format:
      spark-submit [options] --class [MainClass] xxx.jar args
      For this example, the job Job Name is SlsStreaming. The Content field is configured as follows:
      --master yarn-client --driver-memory 7G --executor-memory 5G --executor-cores 1 --num-executors 32 --class com.aliyun.emr.checklist.benchmark.SlsStreaming emr-checklist_2.10-0.1.0.jar <project> <logstore> <access key> <secret key>
      Important
      • If the job JAR package is stored in Object Storage Service (OSS), use ossref://xxx/.../xxx.jar to reference the JAR package.
      • You can also click +Insert OSS Path, set File Prefix to OSSREF, and select a file from the File Path field. The system automatically completes the path of the Spark Streaming script in OSS.
    2. Click Save.