This topic describes how to run commands to access the Presto console.
Prerequisites
An E-MapReduce (EMR) Hadoop or data lake cluster is created, and the Presto service
is selected from the optional services during cluster creation. For more information,
see Create a cluster.
Usage notes
Data lake clusters do not support the Kerberos Authentication feature.
Common cluster
Note If you do not turn on Kerberos Authentication when you create a cluster, the cluster is a common cluster.
- Log on to the Hadoop cluster or Presto cluster in SSH mode. For more information,
see Log on to a cluster.
- Run the following command to go to the Presto console:
Run the presto --help
command to obtain the help information of the Presto console.
- Run the following command to view the schemas contained in the existing catalog:
show schemas;
The following output is returned:
Schema
--------------------
default
emr_presto_init__
information_schema
(3 rows)
- Optional: Run the
quit;
command to log off from the Presto console.
High-security cluster
Note If you turn on Kerberos Authentication when you create a cluster, the cluster is a high-security cluster. Data lake clusters
do not support the Kerberos Authentication feature.
- Log on to the Hadoop cluster or Presto cluster in SSH mode. For more information,
see Log on to a cluster.
- Add a principal and export the keytab file.
- Run the following command to enable the Kerberos administration tool:
- Run the following command to add the principal of a specific key:
addprinc -randkey test
Note In this example, the principal of test is added.
- Run the following command to export the keytab file:
xst -k /root/test.keytab test
By default, the keytab file is exported to the /root/ directory.
- Run the following command to access the Presto console:
presto --server https://<hostname>:7778 \
--catalog hive \
--schema default \
--keystore-path /etc/ecm/presto-conf/keystore \
--keystore-password <passwd> \
--krb5-keytab-path <keytab_file> \
--krb5-principal <username>@EMR.<cluster_id>.COM \
--krb5-remote-service-name presto \
--user <username>
Parameter |
Description |
hostname |
The hostname. You can run the hostname command on the emr-header-1 node of your cluster to obtain the hostname. The hostname
is in the emr-header-1.cluster-xxx format.
|
passwd |
The password. You can run the sed -n 's/http-server.https.keystore.key=\([^;]*\)/\1/p' /etc/ecm/presto-conf/config.properties command on the emr-header-1 node of your cluster to obtain the password.
|
keytab_file |
The path of the exported keytab file. In this example, the path is /root/test.keytab.
|
username |
The principal of the created keytab file. In this example, the principal is test.
|
cluster_id |
The cluster ID. You can run the hostname | grep -Eo '[0-9]+$' command on the emr-header-1 node of your cluster to obtain the cluster ID.
|
The following figure shows the example.

- Run the following command to view the schemas contained in the existing catalog:
- Optional: Run the
quit;
command to log off from the Presto console.
FAQ
Q: What do I do if the "Access Denied: User xxx@EMR.xxx.COM cannot impersonate user
xxx" error message is displayed when I access the Presto console?
A: You need to add a parameter on the
config.properties tab of the Presto service in the EMR console. Set the value of the
http-server.authentication.krb5.user-mapping.pattern parameter to
(.+)@EMR\\.[0-9]+ \. COM and then restart the service.
