Configuring Hadoop Authentication

Learn about how to configure Hadoop Authentication for a Spark Compute.

Hadoop authentication is available only if you have created at least one Spark Compute that is Cloudera Base-Connected. If you have more Cloudera Base-Connected Spark Computes, you need to set up Hadoop authentication only once, and all your Base-Connected Spark Computes will use the specified Principal value, and keytab file or Kerberos password that you provide.

  1. In the Cloudera Data Engineering UI, click Spark Compute in the left navigation menu. The Spark Compute page displays.
  2. Click the Hadoop Authentication button in the top-right corner.
  3. Enter the Principal value.
  4. Under Authentication method, choose one of the following options:
    • Keytab file:

      Under the Authentication method option, select the Keytab file radio button.

      1. Click the Upload button under the Keytab file option and select the relevant keytab file.

        Result: The selected Keytab file is displayed. For instructions about getting the keytab file, see Kerberos Configuration Strategies for CDP.

    • Password:
      1. Under the Authentication method option, select the Password radio button.
      2. In the Password text box, enter your Kerberos password.
  5. Click Authenticate.
Login to CDE CLI and run the following command to configure the Hadoop authentication:
cde kerberos authenticate [***KERBEROS-AUTHENTICATION-FLAG***]
Use one of the following flag value pairs depending on the type of authentication you want to use:
  • Using a password:
    • --principal string – Enter the Kerberos principal when prompted
    • --password – Enter the password when prompted
  • Using the Keytab file:
    • --principal string – Enter the Kerberos principal when prompted
    • --keytab-file string – Enter the keytab file path when prompted
  1. Get the Keytab metadata. For instructions about getting the keytab file, see Kerberos Configuration Strategies for CDP.
    curl -X GET -H "Authorization: Bearer ${CDE_TOKEN}" \
    <service-url>/user-auth/api/v1/kerberos
  2. Update Hadoop Authentication using one of the following methods:
    • Using a password:
      curl -H "Authorization: Bearer ${CDE_TOKEN}" <service-url>/user-auth/api/v1/kerberos \
      -H "Content-Type: application/json" \
      -X POST 
      --form 'principal="<Principal>"' \
      --form 'password="<password>"'
      
    • Using the Keytab file:
      curl -H "Authorization: Bearer ${CDE_TOKEN}" <service-url>/user-auth/api/v1/kerberos \
      -H "Content-Type: application/json" \
      -X POST 
      --form 'principal="<Principal>"' \
      --form 'file=@"</path/to/keytab/file>"'