All Products
Search
Document Center

E-MapReduce:Manage Livy gateways

Last Updated:Mar 26, 2026

A Livy gateway is a REST-based service that lets you submit Apache Spark jobs and query results over HTTP from multiple programming languages. With a Livy gateway, you can connect tools such as the livy_operator of Apache Airflow or the spark_magic of Jupyter Notebook directly to Serverless Spark to submit jobs and obtain status updates.

Prerequisites

Before you begin, make sure you have:

Create a Livy gateway

  1. Log on to the EMR console.

  2. In the left-side navigation pane, choose EMR Serverless > Spark.

  3. On the Spark page, click the name of the target workspace.

  4. In the left-side navigation pane of the EMR Serverless Spark page, click O&M Center > Gateway.

  5. On the Livy Gateway page, click Create Livy Gateway.

  6. Configure the parameters and click Create. For configuration file examples, see Livy configuration file examples.

    ParameterDescription
    NameThe gateway name. Use only lowercase letters, digits, and hyphens (-). The name must start and end with a letter or digit.
    Livy Gateway ResourceThe compute resource allocated to the gateway. Default: 1 CPU, 4 GB.
    Livy VersionThe Livy version. Default: 0.8.0.
    Engine VersionThe Spark engine version used by the gateway. See Engine version introduction.
    Use Fusion AccelerationEnables the Fusion engine to accelerate Spark workloads and reduce job costs. For billing details, see Billing. For engine details, see Fusion engine.
    Associated QueueThe queue where the gateway runs. Jobs submitted through the gateway use the identity of the gateway creator.
    Authentication MethodThe authentication mode. Only Token is supported. After creating the gateway, generate an authentication token to control access. See Manage tokens.
    Network ConnectionThe VPC network connection for accessing data sources or external services.
    EnvironmentThe runtime environment. Resources are pre-installed based on the environment you select.
    Endpoint (Public)Disabled by default. When enabled, the gateway is accessible through a public endpoint. When disabled, the gateway uses an internal endpoint.
    Automatic StopDisabled by default. When enabled, the gateway stops automatically after 45 minutes of inactivity.
    spark-defaults.confThe Spark default configuration file. Sets global default parameters for all Spark jobs submitted through the gateway.
    livy.confThe Livy server configuration file. Defines global gateway behavior including authentication (LDAP), session management, and timeout settings. Applies to all jobs submitted through the gateway.
    livy-client.confThe Livy HTTP client configuration file. Defines the interaction behavior between the client and the gateway.
    spark-blacklist.confA security configuration file that restricts which Spark parameters users can modify when submitting jobs. Parameters listed in this file are ignored by the system and cannot be overridden.
  7. On the Livy Gateway page, click Start in the Actions column of the newly created gateway.

Manage tokens

Each gateway requires an authentication token. Include the token in the x-acs-spark-livy-token header of every request you send through the gateway.

Create a token

  1. On the Livy Gateway page, click Tokens in the Actions column of the target gateway.

  2. Click Create Token.

  3. In the Create Token dialog box, configure the parameters and click OK.

    ParameterDescription
    NameThe token name.
    Expired AtThe token validity period. Must be at least 1 day. Default: 365 days.
  4. Copy the token immediately after it is created.

    Important

    The token is only visible once. After you leave the page, it cannot be retrieved. If your token expires or is lost, reset it or create a new one.

View session information

After creating a Spark session through the Livy interface, view its details on the Sessions tab of the gateway.

  1. On the Livy Gateway page, click the name of the target gateway.

  2. Click the Sessions tab. The tab lists all Spark sessions created through the Livy interface, including each session's ID and status.

    image

What's next