This topic describes how to use Hue in E-MapReduce.

Preparation

Add a security group rule to the security group of your cluster to allow access from port 8888. For more information, see Security groups and Add security group rules.

Notice When setting the authorization object in the security group rule, enter only the CIDR block or IP addresses that need to access Hue. Do not enter the CIDR block 0.0.0.0/0. Otherwise, port 8888 will be enabled for all IP addresses.

View the initial password of the default superuser in Hue

By default, the first user who logs on to Hue after its initial installation becomes the first superuser. For security reasons, E-MapReduce creates an account named admin as the default superuser in Hue and generates a random password as the initial password of the admin account. To view the initial password of the admin account, follow these steps:

  1. Log on to the E-MapReduce console and click the Cluster Management tab. On the page that appears, find the target cluster and click Manage in the Actions column.
  2. In the left-side navigation pane, choose Cluster Service > Hue.
  3. Click the Configure tab and find the admin_pwd parameter. The value of this parameter is the initial password of the admin account.
Notice If you change the value of the admin_pwd parameter in the E-MapReduce console, the new password does not take effect in Hue. To change the initial password of the admin account in Hue, log on to Hue with the admin account and the initial password, and go to the User Admin page to change the password.

Open Hue

The E-MapReduce console provides a link for you to open Hue with one click. To open Hue from the E-MapReduce console, follow these steps:

  1. Log on to the E-MapReduce console and click the Cluster Management tab. On the page that appears, find the target cluster and click Manage in the Actions column.
  2. In the left-side navigation pane, click Connect Strings.
  3. Click the link for accessing Hue.
  4. On the page that appears, enter the username and password to log on to Hue.

Create a Hue account

If you forget the password of your Hue account, you can create a new account by following these steps:

  1. Log on to the E-MapReduce console and click the Cluster Management tab. On the page that appears, find the target cluster and click Manage in the Actions column.
  2. In the left-side navigation pane, click Cluster Overview.
  3. In the Master Instance Group section, find the public network IP address of the master node.
  4. Connect to the master node through Secure Shell (SSH). For more information, see Connect to a cluster using SSH.
  5. Run the following command to create an account:
    /opt/apps/hue/build/env/bin/hue createsuperuser
  6. Enter the username, email address, password, and confirm password. Then, press Enter.

    If the message Superuser created successfully appears, the account is created. You can log on to Hue with the new account.

Modify the Hue configuration

To modify the Hue configuration, follow these steps:

  1. Log on to the E-MapReduce console and click the Cluster Management tab. On the page that appears, find the target cluster and click Manage in the Actions column.
  2. In the left-side navigation pane, choose Cluster Service > Hue and click the Configure tab.
  3. On the Configure tab, click Custom Configuration in the upper-right corner and add or modify key-value pairs. Enter a key in the following format:
    $section_path.$real_key
    Note
    • Replace $real_key with the actual key to be added or modified, such as hive_server_host.
    • Replace $section_path with the section where the key resides in the hue.ini file.

      For example, if the hive_server_host key resides in the [beeswax] section in the hue.ini file, replace $section_path with beeswax.

    • The key entered in this example is beeswax.hive_server_host.
    • If the path to a key involves multiple nested sections in the hue.ini file, for example, [desktop] -> [[ldap]] -> [[[ldap_servers]]] -> [[[[users]]]] -> user_name_attr, enter the key in the format of desktop.ldap.ldap_servers.users.user_name_attr.

Configure YARN queues

When you submit SQL statements in Hue to perform interactive queries, Hue applies to YARN for computing resources. To manage and isolate computing resources for different Hive SQL or Spark SQL jobs, you can configure YARN queues by following these steps:

  1. Log on to the E-MapReduce console and click the Cluster Management tab. On the page that appears, find the target cluster and click Manage in the Actions column.
  2. Add or modify the queue configuration.

    • For Hive SQL, configure the queue parameter in HiveServer2 based on the engine type.
      Notice The QUEUENAME variable indicates the name of the queue to be configured.
      1. In the left-side navigation pane, choose Cluster Service > Hive and click the Configure tab.
      2. In the Service Configuration section, click the hiveserver2-site tab.
      3. Modify the queue parameter or click Custom Configuration in the upper-right corner to add the queue parameter if it does not exist.
        Engine Parameter Description
        Hive on MR mapreduce.job.queuename QUEUENAME
        Hive on Tez tez.queue.name
        Hive on Spark spark.yarn.queue
    • For Spark SQL, use Spark Thrift Server to perform SQL queries. Configure the queue parameter in Spark Thrift Server by following these steps:
      1. In the left-side navigation pane, choose Cluster Service > Spark and click the Configure tab.
      2. In the Service Configuration section, click the spark-thriftServer tab.
      3. Modify the queue parameter or click Custom Configuration in the upper-right corner to add the queue parameter if it does not exist.

        spark.yarn.queue: QUEUENAME

  3. Restart HiveServer2 and Spark Thrift Server in the cluster where Hue resides.