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 DataLake cluster with the Spark and OpenLDAP services selected. For more information, see create a cluster.
The examples in this topic use Spark3.
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 Spark3 service and click Status.
-
Turn on the enableLDAP switch.
-
For EMR-5.11.1 or later, and EMR-3.45.1 or later:
-
In the Service Overview section, turn on the enableLDAP switch.
-
In the dialog box that appears, click OK.
-
-
For EMR-5.11.0 or earlier, and EMR-3.45.0 or 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 SparkThriftServer, click the .
-
In the dialog box that appears, enter a reason in the Execution Reason field and click OK.
-
In the Confirm dialog box, click OK.
-
-
-
Restart SparkThriftServer.
-
In the Components section, find SparkThriftServer and click Restart in the Actions column.
-
In the dialog box that appears, enter a reason in the Execution Reason field and click OK.
-
In the Confirm dialog box, click OK.
-
-
-
Connect to SparkThriftServer.
After enabling LDAP authentication, use your LDAP credentials to connect to SparkThriftServer.
-
Log on to the cluster using SSH. For more information, see log on to a cluster.
-
Run the following command to connect to SparkThriftServer.
-
Beeline client:
spark-beeline -u jdbc:hive2://master-1-1:10001 -n <user> -p <password> -
JDBC:
jdbc:hive2://master-1-1:10001/default;user=<user>;password=<password>
NoteIn these commands, replace <user> with the LDAP username and <password> with the LDAP password. These are the credentials for the user that you added in Step 1.
-
-
-
Optional: Disable LDAP authentication.
-
On the Services page, find the Spark3 service and click Status.
-
Turn off the enableLDAP switch.
-
For EMR-5.11.1 or later, and EMR-3.45.1 or later:
-
In the Service Overview section, turn off the enableLDAP switch.
-
In the dialog box that appears, click OK.
-
-
For EMR-5.11.0 or earlier, and EMR-3.45.0 or earlier:
-
In the Components section, find SparkThriftServer, click the .
-
In the dialog box that appears, enter a reason in the Execution Reason field and click OK.
-
In the Confirm dialog box, click OK.
-
-
-
Restart SparkThriftServer.
-
In the Components section, find SparkThriftServer and click Restart in the Actions column.
-
In the dialog box that appears, enter a reason in the Execution Reason field and click OK.
-
In the Confirm dialog box, click OK.
-
-
> enableLDAP