This is the documentation for Cloudera Search 1.3.0 for CDH 4.
Documentation for other versions is available at Cloudera Documentation.

Configuring Search to Use Kerberos

Cloudera Search supports Kerberos authentication. All necessary packages are installed when you install Search. To enable Kerberos, create principals and keytabs and then modify default configurations.

The following instructions only apply to configuring Kerberos in an unmanaged environment. Kerberos configuration is automatically handled by Cloudera Manager if you are using Search in a Cloudera managed environment.

To create principals and keytabs

Repeat this process on all Solr server nodes.

  1. Create a Solr service user principal using the syntax: solr/<fully.qualified.domain.name>@<YOUR-REALM>. This principal is used to authenticate with the Hadoop cluster. where: fully.qualified.domain.name is the host where the Solr server is running YOUR-REALM is the name of your Kerberos realm.
    $ kadmin
    kadmin: addprinc -randkey solr/fully.qualified.domain.name@YOUR-REALM.COM
  2. Create a HTTP service user principal using the syntax: HTTP/<fully.qualified.domain.name>@<YOUR-REALM>. This principal is used to authenticate user requests coming to the Solr web-services. where: fully.qualified.domain.name is the host where the Solr server is running YOUR-REALM is the name of your Kerberos realm.
    kadmin: addprinc -randkey HTTP/fully.qualified.domain.name@YOUR-REALM.COM
      Note:

    The HTTP/ component of the HTTP service user principal must be upper case as shown in the syntax and example above.

  3. Create keytab files with both principals.
    kadmin: xst -norandkey -k solr.keytab solr/fully.qualified.domain.name \
    HTTP/fully.qualified.domain.name
  4. Test that credentials in the merged keytab file work. For example:
    $ klist -e -k -t solr.keytab
  5. Copy the solr.keytab file to the Solr configuration directory. The owner of the solr.keytab file should be the solr user and the file should have owner-only read permissions.

To modify default configurations

Repeat this process on all Solr server nodes.

  1. Ensure that the following properties appear in /etc/default/solr and that they are uncommented. Modify these properties to match your environment. The relevant properties to be uncommented and modified are:
    SOLR_AUTHENTICATION_TYPE=kerberos
    SOLR_AUTHENTICATION_SIMPLE_ALLOW_ANON=true
    SOLR_AUTHENTICATION_KERBEROS_KEYTAB=/etc/solr/conf/solr.keytab
    SOLR_AUTHENTICATION_KERBEROS_PRINCIPAL=HTTP/localhost@LOCALHOST
    SOLR_AUTHENTICATION_KERBEROS_NAME_RULES=DEFAULT
    SOLR_AUTHENTICATION_JAAS_CONF=/etc/solr/conf/jaas.conf
      Note: Modify the values for these properties to match your environment. For example, the SOLR_AUTHENTICATION_KERBEROS_PRINCIPAL=HTTP/localhost@LOCALHOST must include the principal instance and Kerberos realm for your environment. That is often different from localhost@LOCALHOST.
  2. If using applications that use the solrj library, set up the Java Authentication and Authorization Service (JAAS).
    1. Create a jaas.conf file in the Solr configuration directory containing the following settings. This file and its location must match the SOLR_AUTHENTICATION_JAAS_CONF value. Make sure that you substitute a value for principal that matches your particular environment.
      Client {
        com.sun.security.auth.module.Krb5LoginModule required
        useKeyTab=true
        useTicketCache=false
        keyTab="/etc/solr/conf/solr.keytab"
        principal="solr/fully.qualified.domain.name@<YOUR-REALM>";
      };
  3. To use short principal names:
    • For Search 1.x: Appendix C - Configuring the Mapping from Kerberos Principals to Short Names in the CDH 4 Security Guide.
    • For Search included with CDH 5: Appendix C - Configuring the Mapping from Kerberos Principals to Short Names in the CDH 5 Security Guide.