New Contributor
Posts: 4
Registered: ‎01-23-2015

SolrJ unable to connect to Kerberorized Solr

[ Edited ]

We have a Kerborized Solr instance that we are unable to access with SolrJ using a keytab. Using the Cloudera Search Authentication as a guide, we first create a jaas-client.conf file with the following contents:


Client { required

 Please note that I obfuscated the path and principal for security reasons. 


I also set the following property:


System.setProperty("", configFile.getAbsolutePath());


With this setup, I expect the client to use the solr/ principal from the solr.keytab but I am prompted for the Kerberos principal and password from STDIN. 


If I perform a kinit for the SOLR principal using this keytab, the client is able to connect to SOLR without issue. 


Solr documentation also suggests the following:



System.setProperty("", configFile.getAbsolutePath());
HttpClientUtil.setConfigurer(new Krb5HttpClientConfigurer());




When I step through the code, I can see Krb5HttpClientConfigurer() being called so I am not sure why the SolrJ client is unable to supply the Kerberos credentials. 


We are running CHD 5.4.9 with Solr 4.10.3 with the following SolrJ POM dependency:




New Contributor
Posts: 2
Registered: ‎02-18-2019

Re: SolrJ unable to connect to Kerberorized Solr

Add the below two statements in your code

System.setProperty("", REALM);
System.setProperty("", REALM+":88");