By default, you can directly access the Presto service of an E-MapReduce (EMR) cluster
from Hue in EMR V3.33.0 or a later minor version, or in EMR V4.6.0 or a later minor
version. In a minor version earlier than EMR V3.33.0 or EMR V4.6.0, to access the
Presto service of an EMR cluster from Hue, you must configure the related parameters
for Hue. This topic describes how to configure the parameters.
Prerequisites
- A cluster of a minor version earlier than EMR V3.33.0 or EMR V4.6.0 is created, and
Presto is selected from the optional services during cluster creation. For more information,
see Create a cluster.
- Port 8888 is enabled. For more information, see Access the web UIs of open source components.
Notice When you set the authorization object in the security group rule, enter only the CIDR
blocks or IP addresses that need to access Hue. Do not enter the CIDR block 0.0.0.0/0.
Step 1: Download the JDBC driver of Presto
- Log on to the cluster in SSH mode. For more information, see Log on to a cluster.
- Run the following command to create a directory named presto-jdbc:
mkdir -p /opt/apps/presto-jdbc/
- Download the required Java Database Connectivity (JDBC) JAR package and upload it
to the /opt/apps/presto-jdbc/ directory.
- Download presto-jdbc.
You can determine the JDBC JAR package to be downloaded based on the version of your
EMR cluster. In this example, the cluster version is EMR V3.32.0, which corresponds
to Presto 338. Therefore, you must download the JDBC JAR package whose version is
338.
The following figure shows the JDBC JAR package.

- Upload the JAR package to the /opt/apps/presto-jdbc/ directory. For more information, see Upload objects.
- Run the following command to modify file permissions:
chmod 644 /opt/apps/presto-jdbc/*
- Run the following command to edit the hue.sh file:
vim /etc/profile.d/hue.sh
- Add the following content to the end of the hue.sh file:
export CLASSPATH=/opt/apps/presto-jdbc/*:$CLASSPATH
The following figure shows the added content in the file.

Step 2: Load the JDBC driver of Presto
- Go to the Hue configuration tab.
- Log on to the Alibaba Cloud EMR console.
- In the top navigation bar, select the region where your cluster resides and select a resource group based on your business requirements.
- Click the Cluster Management tab.
- Find your cluster and click Details in the Actions column.
- In the left-side navigation pane, choose .
- On the Hue service page, click the Configure tab.
- In the Service Configuration section, click the hue tab.
- Add parameters to Hue.
- Click Custom Configuration in the upper-right corner.
- In the Add Configuration Item dialog box, add the following parameters.
Parameter |
Description |
notebook.interpreters.presto.name |
Set the parameter to Presto.
|
notebook.interpreters.presto.interface |
Set the parameter to jdbc.
|
notebook.interpreters.presto.options |
Set the parameter to {"url": "jdbc:presto://emr-header-1:9090/hive/default", "driver": "com.facebook.presto.jdbc.PrestoDriver",
"user": "hadoop", "password": ""}.
|
- Click OK.
- Save the configurations.
- In the upper-right corner of the Service Configuration section, click Save.
- In the Confirm Changes dialog box, specify Description and turn on Auto-update Configuration.
- Click OK.
- Deploy client configurations.
- In the upper-right corner of the Service Configuration section, click Deploy Client Configuration.
- In the Cluster Activities dialog box, specify Target Nodes, Actions on Failures, and Description.
- Click OK.
- In the Confirm message, click OK.
Click History in the upper-right corner to view the task progress.
- Restart Hue.
- In the upper-right corner of the Hue service page, choose .
- In the Cluster Activities dialog box, specify Target Nodes, Actions on Failures, and Description.
- Click OK.
- In the Confirm message, click OK.
Click History in the upper-right corner to view the task progress.
Step 3: Access the Presto service of the EMR cluster from Hue
- In the left-side navigation pane of the Cluster Overview page, click Connect Strings.
- Click the URL of Hue.

Log on to the Hue web UI as the default user admin. For more information about how
to obtain the initial password, see View the initial password.
- Access the Presto service of the EMR cluster on the Hue web UI.
Information about Presto is displayed on the Hue web UI. You can access the Presto
service of the EMR cluster.

- Optional:Test connectivity.
- On the Hue web UI, choose .
- Run the following command to query the schemas on your cluster:
show schemas
The query results are displayed on the Results tab, as shown in the following figure.
