Complete the code to initialize Kerberos authentication in Hadoop configuration.
conf.set("hadoop.security.authentication", "[1]")
Setting hadoop.security.authentication to kerberos enables Kerberos authentication in Hadoop.
Complete the code to login a user from a keytab file using Hadoop's UserGroupInformation.
UserGroupInformation.[1](principal, keytabFilePath)The method loginUserFromKeytab logs in a user using a principal and keytab file for Kerberos authentication.
Fix the error in the code to set the Kerberos realm in the configuration.
conf.set("[1]", "EXAMPLE.COM")
The correct property to set the Kerberos realm is hadoop.security.krb5.realm.
Fill both blanks to create a map of user principals to local usernames using the auth_to_local rules.
conf.set("[1]", "RULE:[1:$1@$0](.*@EXAMPLE.COM)s/@EXAMPLE.COM//") conf.set("[2]", "kerberos")
The hadoop.security.auth_to_local property defines rules to map Kerberos principals to local usernames. The hadoop.security.authentication property must be set to kerberos to enable Kerberos authentication.
Fill all three blanks to configure Kerberos KDC, realm, and enable authentication in Hadoop configuration.
conf.set("[1]", "kdc.example.com") conf.set("[2]", "EXAMPLE.COM") conf.set("[3]", "kerberos")
Set hadoop.security.krb5.kdc to the KDC server, hadoop.security.krb5.realm to the Kerberos realm, and hadoop.security.authentication to kerberos to enable Kerberos authentication.