When you submit an SQL statement in Hue to perform an interactive query, Hue submits an application for computing resources to YARN. To manage and isolate computing resources for different Hive SQL or Spark SQL jobs, you must configure YARN queues. This topic describes how to configure YARN queues.

Prerequisites

An E-MapReduce (EMR) Hadoop cluster is created. For more information, see Create a cluster.

Procedure

  1. Go to the Cluster Overview page of your cluster.
    1. Log on to the Alibaba Cloud EMR console by using your Alibaba Cloud account.
    2. In the top navigation bar, select the region where your cluster resides and select a resource group based on your business requirements.
    3. Click the Cluster Management tab.
    4. On the Cluster Management page, find your cluster and click Details in the Actions column.
  2. Modify queue configurations or add custom items.
    Note If you want to modify an existing queue parameter, you can search for the parameter on the Configure tab and change the value.
    • For Hive SQL, configure a queue parameter in HiveServer2 based on the engine type.
      1. In the left-side navigation pane, choose Cluster Service > Hive.
      2. On the Hive service page, click the Configure tab.
      3. In the Service Configuration section, click the hiveserver2-site tab.
      4. On the hiveserver2-site tab, click Custom Configuration in the upper-right corner. In the Add Configuration Item dialog box, add a custom parameter.
        Engine Parameter Description
        Hive on MR mapreduce.job.queuename The name of the queue. You can customize a queue name.

        In this example, the value of the parameter is QUEUENAME.

        Hive on Tez tez.queue.name
        Hive on Spark spark.yarn.queue
      5. After you add the parameter, click OK.
      6. Save the configuration.
        1. In the upper-right corner of the Service Configuration section, click Save.
        2. In the Confirm Changes dialog box, specify Description and click OK.
    • For Spark SQL, Spark Thrift Server is used to perform SQL queries. Perform the following steps to configure a queue parameter in Spark Thrift Server:
      1. In the left-side navigation pane, choose Cluster Service > Spark.
      2. Click the Configure tab.
      3. In the Service Configuration section, click the spark-thriftserver tab.
      4. On the spark-thriftserver tab, click Custom Configuration in the upper-right corner.
      5. In the Add Configuration Item dialog box, add the spark.yarn.queue parameter, set it to QUEUENAME, and then click OK.
      6. Save the configuration.
        1. In the upper-right corner of the Service Configuration section, click Save.
        2. In the Confirm Changes dialog box, specify Description and click OK.
  3. Restart the related component.
    • Restart the HiveServer2 component of Hive.
      1. In the left-side navigation pane, choose Cluster Service > Hive.
      2. Click the Component Development tab. Find the HiveServer2 component and click Restart in the Actions column.
      3. In the Cluster Activities dialog box, specify Description and click OK.
      4. In the Confirm message, click OK.
    • Restart the ThriftServer component of Spark.
      1. In the left-side navigation pane, choose Cluster Service > Spark.
      2. Click the Component Development tab. Find the ThriftServer component and click Restart in the Actions column.
      3. In the Cluster Activities dialog box, specify Description and click OK.
      4. In the Confirm message, click OK.