After LDAP authentication is enabled for a service, you must provide your LDAP username and password when you access the service. This improves the security of the service. You can enable LDAP authentication for a service in the EMR console by performing simple operations. This frees you from the complex configuration of LDAP authentication.
Prerequisites
You have created a cluster that includes the Trino and OpenLDAP services. For more information, see Create a cluster.
Usage notes
If you cannot connect to EMR V3.43.1 or V5.9.1 after you enable LDAP, the cause is likely a missing configuration on worker nodes. You must log on to the master-1-1 node to find the value of the
internal-communication.shared-secretparameter in the Presto config.properties file. Then, in the console, add this configuration to the Core and Task node groups. For more information about how to add a configuration item, see Add a configuration item.LDAP authentication and Kerberos for Trino are mutually exclusive. You can enable only one at a time.
Procedure
Add an EMR user. For more information, see Add a user.
Go to the Services tab.
Log on to the EMR console.
In the left-side navigation pane, click EMR on ECS.
In the top navigation bar, select the region in which your cluster resides and select a resource group based on your business requirements.
On the EMR on ECS page, find the desired cluster and click Services in the Actions column.
Enable LDAP authentication.
On the Services page, find the Trino service and click Status.
Enable LDAP.
For EMR V5.11.1 and later, and EMR V3.45.1 and later
In the Service Overview section, turn on the TrinoLDAP switch.
In the dialog box that appears, click OK.
For EMR V5.11.0 and earlier, and EMR V3.45.0 and earlier
ImportantFor earlier EMR versions that lack a dedicated button, you must configure LDAP authentication manually. For more information, refer to the relevant open-source documentation.
In the Components section, find TrinoMaster and choose
> enableLDAP in the Actions column.In the dialog box that appears, enter an Execution Reason and click OK.
In the Confirm dialog box, click OK.
Restart TrinoMaster.
In the Components section, find TrinoMaster and click restart in the Actions column.
In the dialog box that appears, enter an Execution Reason and click OK.
In the Confirm dialog box, click OK.
Connect to the Trino service.
Log on to the cluster by using SSH. For more information, see Log on to a cluster.
Run the following command to access Trino.
ImportantWhen high security is enabled, you must use port 7778 to access Trino over HTTPS. This closes the original port 9090 and renders the http-server.http.port parameter setting invalid.
trino --server https://{fqdn}:7778 --keystore-path {keystore_location} \ --keystore-password {keystore_passwd} --catalog hive --user {user} --passwordParameter
Description
{fqdn}
The fully qualified domain name (FQDN) of the Trino master node.
On the Configure tab of the Trino service page in the E-MapReduce console, select Dedicated Node Configuration and master-1-1. Then, view the ldap.url parameter to obtain the FQDN of the keystore. The FQDN is in the
master-1-1.c-xxxxxxx.cn-x******.emr.aliyuncs.comformat.{keystore_location}
The path of the keystore.
This is the value of the
http-server.https.keystore.pathparameter in the config.properties file. The path is/etc/emr/trino-conf/keystore.{keystore_passwd}
The password of the keystore.
This is the value of the
http-server.https.keystore.keyparameter in the config.properties file. You must retrieve the password yourself. You can run the following command on the master-1-1 node to retrieve it:awk -F= '/http-server.https.keystore.key/{print $2}' ${TRINO_CONF_DIR}/config.properties.{user}
The LDAP username. This is the username that you added in Step 1.
When prompted, enter the LDAP password that you set in Step 1.
Optional: Disable LDAP authentication.
On the Services page, find the Trino service and click Status.
Disable LDAP.
For EMR V5.11.1 and later, and EMR V3.45.1 and later
In the Service Overview section, turn off the TrinoLDAP switch.
In the dialog box that appears, click OK.
For EMR V5.11.0 and earlier, and EMR V3.45.0 and earlier
In the Components section, find TrinoMaster and choose
> disableLDAP in the Actions column.In the dialog box that appears, enter an Execution Reason and click OK.
In the Confirm dialog box, click OK.
Restart TrinoMaster.
In the Components section, find TrinoMaster and click restart in the Actions column.
In the dialog box that appears, enter an Execution Reason and click OK.
In the Confirm dialog box, click OK.