After you enable Lightweight Directory Access Protocol (LDAP) authentication, you must provide an LDAP username and password to access the service, which enhances its security. EMR lets you enable LDAP authentication with a single click, eliminating complex configuration. This topic describes how to enable LDAP authentication for the Presto service and how to connect to it.
Prerequisites
A cluster with the Presto and OpenLDAP services is required. For more information, see Create a cluster.
Notes
-
This feature is available only for common clusters. LDAP authentication is not supported on high-security clusters.
-
For earlier EMR versions that lack a dedicated button, you must configure LDAP authentication manually. For more information, refer to the relevant open-source documentation.
Steps
-
Add an EMR user.
-
Log on to the EMR on ECS console.
-
In the top navigation bar, select a region and resource group.
-
Find the target cluster and click Nodes in the Actions column.
-
Click the Users tab.
-
Add a user. For more information, see Add a user.
-
-
Enable LDAP authentication.
-
Click the Services tab.
-
On the Services page, find the Presto service and click Status.
-
In the Service Overview section, turn on the PrestoLDAP switch.
-
In the dialog box, click OK.
-
Restart PrestoMaster.
-
In the Components section, find PrestoMaster and click Restart in the Actions column.
-
In the dialog box, enter a reason in the Execution Reason field and click OK.
-
In the Confirm dialog box, click OK.
-
-
-
Connect to the Presto service.
After enabling LDAP authentication, you must provide LDAP credentials to access Presto.
-
Log on to the cluster using SSH. For more information, see Log on to a cluster.
-
Run the following command to access Presto.
ImportantAfter enabling LDAP authentication, Presto is accessible only over HTTPS on port 7779. The HTTP port 8889 is disabled, and the UI is no longer accessible at its previous address. This is because the http-server.http.port is overridden by the http-server.https.port setting.
presto --server https://{fqdn}:7779 --keystore-path {keystore_location} \ --keystore-password {keystore_passwd} --catalog hive --user {user} --passwordParameter
Description
{fqdn}
The FQDN of the master-1-1 node. You can run the
hostname -fcommand to obtain the FQDN. The FQDN is in themaster-1-1.c-xxxxxxx.cn-xxxxxx.emr.aliyuncs.comformat.{keystore_location}
The path to the keystore file.
This is the value of
http-server.https.keystore.pathin the config.properties file. The path is always/etc/emr/presto-conf/keystore.{keystore_passwd}
The password for the keystore.
This is the value of
http-server.https.keystore.keyin the config.properties file. To obtain the password, run theawk -F= '/http-server.https.keystore.key/{print $2}' ${PRESTO_CONF_DIR}/config.propertiescommand on the master-1-1 node.{user}
The LDAP username. This is the username you added in Step 1.
After you run the command, enter the password when prompted. Use the password you set for the LDAP user in Step 1.
-
-
(Optional) Disable LDAP authentication.
-
In the Service Overview section of the Presto service, turn off the PrestoLDAP switch.
-
In the dialog box, click OK.
-
Restart PrestoMaster.
-
In the Components section, find PrestoMaster and click Restart in the Actions column.
-
In the dialog box, enter a reason in the Execution Reason field and click OK.
-
In the Confirm dialog box, click OK.
-
-