Page tree
Skip to end of metadata
Go to start of metadata


Apache Ranger supports Apache Solr 5.2 in SolrCloud mode. For enabling Ranger authorization, the following need to be done:

  1. Install Apache Solr 5.2
  2. Install and configure Kerberos
  3. Configure SolrCloud

Install Apache Solr 5.2

Download Apache Solr 5.2 from Extract the package on all the servers.

Install and configure Kerberos

Follow the below instructions. You might want to replace everything that is in bold with your custom values.

  • Install and configure MIT Kerberos. If you have ActiveDirectory in your environment, then you can use ActiveDirectory as your Kerberos KDC.
  • Create principal "solr" in your KDC. You can make it host specific or headless
    • For MIT KDC, login as root on to server which has KDC and create the keytabs for user solr and HTTP

    • The above example creates headless keytab for service user "solr". It is recommend to create keytab per host. If you wish to do that, then for each host where Solr is going to run, create a principal like above, except use the principal name with the host, e.g. addprinc -randkey solr/${HOST1}@EXAMPLE.COM. Replace ${HOST1} with the actual host names

    • You will also need another keytab for SPNEGO. This is used by Solr for authenticating HTTP request. Follow the above process, but replace solr with HTTP. E.g.

    • After the keytabs is created you need to copy them to all the hosts running Solr. And chown to solr and chmod to 400.

Configuring SolrCloud

Follow the below instructions. You might want to replace everything that is in bold with your custom values.

  • Install ZooKeeper and setup the ensemble. If you are using Hadoop, it is very likely you might already have Zookeeper installed and configured. Else, follow the instruction from Solr site for configuring ZooKeeper.
  • Create path in zookeeper for storing the Solr configs and other parameters. 
    • $SOLR_INSTALL_HOME/server/scripts/cloud-scripts/ -zkhost $ZK_HOST:281 -cmd makepath solr
  • Upload your collection config to zookeeper. Below is an example to upload a default config packaged in Solr
    • $SOLR_INSTALL_HOME/server/scripts/cloud-scripts/ -cmd upconfig  -zkhost $ZK_HOST:2181/solr -confname basic_configs -confdir $SOLR_INSTALL_HOME/server/solr/configsets/basic_configs/conf
  • Create a new JAAS file at the path /etc/solr/conf and replace the REALM name @EXAMPLE.COM with your REALM name.

  • Copy the solr_jaas.conf to all the host which are running Solr
  • Update in $SOLR_INSTALL_HOME/bin/

    vi $SOLR_INSTALL_HOME/bin/ and add the below lines at the end

    SOLR_HOST=`hostname -f`
    SOLR_AUTHENTICATION_OPTS="$SOLR_JAAS_FILE -Dsolr.kerberos.principal=${SOLR_KERB_PRINCIPAL} -Dsolr.kerberos.keytab=${SOLR_KERB_KEYTAB} -Dsolr.kerberos.cookie.domain=${SOLR_HOST} -Dhost=${SOLR_HOST}"


  • Copy to all the host which will be running Solr
  • Enable Kerberos as the authentication scheme by updating security.json in zookeeper

  • Now restart Solr on all hosts. With this setting only access via Kerberos authentication is enabled. For configuring authorization, you can now use Ranger for Solr, refer to Apache Ranger 0.5.0 Installation#EnablingRangerSolrPlugin


Connecting to Kerberos enabled Solr from your local machine.

  • On Linux and Mac, copy /etc/krb5.conf from the Solr host to your local /etc/krb5.conf. If you already have a local /etc/krb5.conf, then you could merge both
  • Create an user on the KDC.
    • Go to the KDC and login as root

      # kadmin.local 
      addprinc $USERNAME@EXAMPLE.COM

  • On your local machine
  • Use Safari and FireFox to connect to your Solr URL

Trouble Shooting

Kerberos not working

There could be multiple issues, the common ones are:

  • Make sure the user "solr" has permissions to read the keytab files and jaas config file.
  • Make sure the is updated properly







  • No labels