This topic describes how to configure and access Hue on E-MapReduce. You can use Hue to interact with a Hadoop cluster from a browser to analyze and process data.
Prerequisites
-
The access rules for the security group are configured.
ImportantWhen you configure security group rules, allow access only from a limited range of IP addresses. Do not allow access from 0.0.0.0/0.
-
Port 8888 is open.
Notes
For Hadoop clusters running on E-MapReduce 3.35.0 or later, or E-MapReduce 4.9.0 or later, note the following:
-
To use Hue Workflow jobs, go to the Hue configuration tab and remove jobbrowser from the value of the app_blacklist parameter. On the Configure tab, enter
app_blacklistin the search box to locate the parameter. By default, the value also includesjobbrowser. -
To browse or manage HDFS directories from the Hue UI, go to the Hue configuration tab, remove filebrowser from the value of the app_blacklist parameter, and start the HttpFS component for the HDFS service. If the HttpFS component is stopped, go to the Deployment Topology page of the HDFS service, find the HttpFS component, and click Start in the Actions column.
View the initial password
By default, the first user who logs on to Hue becomes the administrator if no administrator is configured. For security purposes, E-MapReduce creates an administrator account named admin for the Hue service and sets a random initial password for it. Follow these steps to view the initial password:
-
Log on to the E-MapReduce console.
-
In the top navigation bar, select a region and a resource group as needed.
-
Click the Clusters tab.
-
On the Clusters page, find the cluster and click Details in the Actions column.
-
In the left navigation pane, click Services, and then select Hue from the service list.
-
Click the Configure tab and find the admin_pwd parameter. The value of this parameter is the random password.
ImportantThe admin_pwd parameter specifies only the initial password for the
adminaccount. Changing this parameter in the E-MapReduce console does not update the password in Hue. To change the logon password for theadminaccount, use the initial password to log on to Hue and change it in the user management module, or reset the account password.
Access Hue
-
On the Clusters page, find the cluster and click Details in the Actions column.
-
In the left navigation pane, click Access Links and Ports.
-
Click the link for the Hue service.
-
Enter your Hue username and password.
Create a user account
-
On the Clusters page, find the cluster and click Details in the Actions column.
-
In the Master Node Group section, obtain the public IP address of the master node.
-
Log on to the master node. For more information, see Log on to a cluster.
-
Run the following command to create a new superuser account:
-
Enter a new username and email address, enter a password, confirm the password, and then press Enter.
The message Superuser created successfully indicates that the new account is created. You can then log on to Hue with this account.
Reset an account password
-
Log on to the master node over SSH. For more information, see Log on to a cluster.
-
Run the following command to view the path to Hue:
ps aux | grep hueThe following output is an example.
[root@emr-header-1 ~]# ps aux | grep hue root 3831 1.8 0.4 401888 73696 pts/2 S+ 16:25 0:01 /opt/apps/hue/build/env/bin/python2.7 hue/build/env/bin/hue shell root 5949 0.0 0.0 112716 960 pts/1 S+ 16:26 0:00 grep --color=auto hue root 7832 0.0 0.1 369196 19820 ? Sl 15:13 0:01 /opt/apps/hue/build/env/bin/python2.7 /usr/lib/hue-current/build/env/bin/supervisor hue 8019 0.1 0.8 2954004 135800 ? Sl 15:13 0:06 /opt/apps/hue/build/env/bin/python2.7 /opt/apps/hue/build/env/bin/hue runcherrypyserver root 30881 0.3 0.4 401888 73804 pts/0 S+ 16:22 0:00 /opt/apps/hue/build/env/bin/python2.7 /opt/apps/hue/build/env/bin/hue shellNoteIn this example, the path to Hue is /opt/apps/hue/build/env/bin/hue.
-
Run the
hue shellcommand using the path obtained in the previous step. For example, /opt/apps/hue/build/env/bin/hue shell. Then, in the interactive shell, enter the following commands to reset the user password:from django.contrib.auth.models import User user = User.objects.get(username='your username') # Enter the username whose password you want to reset. user.set_password('your new password') # Enter the new password. user.save()NotePress Ctrl+D to exit the shell.
Add configurations
-
On the Clusters page, find the cluster and click Details in the Actions column.
-
In the left navigation pane, choose .
-
Click the Configure tab.
-
In the Service Configuration section, click hue.
-
In the upper-right corner, click Custom Configuration to add a key and value.
$section_path.$real_keyThe following list describes the parameters:
-
$real_keyis the actual key that you want to add, such ashive_server_host. -
$section_pathcan be obtained from the hue.ini file.For example, the hue.ini file shows that
hive_server_hostbelongs to the[beeswax]section. In this case,$section_pathisbeeswax.NoteTherefore, the key that you add is
beeswax.hive_server_host. If you want to modify a value in nested sections of the hue.ini file (for example, user_name_attr under [desktop] -> [[ldap]] -> [[[ldap_servers]]] -> [[[[users]]]]), you must set the key todesktop.ldap.ldap_servers.users.user_name_attr.
-
Configure YARN queues
When you run interactive SQL queries in Hue, Hue requests computing resources from YARN. To manage and isolate computing resources, you must configure the corresponding queues for HiveSQL and SparkSQL.
-
On the Clusters page, find the cluster and click Details in the Actions column.
-
-
For HiveSQL, configure HiveServer2 based on the engine.
ImportantReplace QUEUENAME with the name of the queue that you want to configure.
-
In the left navigation pane, choose .
-
Click the Configure tab.
-
In the Service Configuration section, click the hiveserver2-site tab.
-
In the upper-right corner, click Custom Configuration to add the following parameters:
Engine
Parameter
Description
Hive on MR
mapreduce.job.queuename
QUEUENAME
Hive on Tez
tez.queue.name
Hive on Spark
spark.yarn.queue
NoteTo modify an existing configuration, you can find the parameter and change its value directly on the Service Configuration page.
-
-
SparkSQL uses SparkThriftServer. Modify the spark-thriftServer configuration or add a custom configuration in the Spark component:
-
In the left navigation pane, choose .
-
Click the Configure tab.
-
In the Service Configuration section, click the spark-thriftServer tab.
-
In the upper-right corner, click Custom Configuration, and set the spark.yarn.queue parameter to QUEUENAME.
-
-
-
Restart HiveServer2 and Spark ThriftServer.
-
On the Clusters page, choose .
-
In the Components section, find HiveServer2 and click Restart in the Actions column.
Enter the required information and click OK.
-
On the Clusters page, choose .
-
In the Components section, find ThriftServer and click Restart in the Actions column.
Enter the required information and click OK.
-