Reply
Explorer
Posts: 6
Registered: ‎06-10-2015

message:Unauthorized for Solr After Kerberos Enabled

Hi Team,

 

I used Cloudera Quick VM and enabled kerberos ,  therefore worked with HDFS, HIVE, HBASE. Need to work with SOLR which is kerberos enabled in Cloudera Quick VM.

 Could You please anyone  guide me to work with solr enabled kerberos ??

 

I have written a sample standalone code which giving the following exception

 

		File file=new File("/home/cloudera/Desktop/FTP.pptx");
		System.setProperty("java.security.auth.login.config", "/etc/solr/jaas.conf");
		HttpClientUtil.setConfigurer(new HttpClientConfigurer());

		UserGroupInformation.loginUserFromKeytab("solr/quickstart.cloudera@CLOUDERA",
				"/etc/solr/conf/solr.keytab");
		
		solrServer = new HttpSolrServer("http://quickstart.cloudera:8983/solr/new_core");
		solrServer.getBinder();

		SolrPingResponse pingResponse	=	solrServer.ping();
		String 	pingStatus =	(String)pingResponse.getResponse().get("status");

and giving the following exception 

 

org.apache.solr.client.solrj.impl.HttpSolrServer$RemoteSolrException: Server at http://quickstart.cloudera:8983/solr/new_core returned non ok status:401, message:Unauthorizedfinallly
at org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:385)
at org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:180)
at org.apache.solr.client.solrj.request.SolrPing.process(SolrPing.java:69)
at org.apache.solr.client.solrj.SolrServer.ping(SolrServer.java:293)
at com.solix.fileattributes.FileAttributes.test(FileAttributes.java:80)
at com.solix.fileattributes.FileAttributes.main(FileAttributes.java:42)

 

Thank you in advance 

 

 

Thanks & Regards,

Sai Pavan G

 

Highlighted
Cloudera Employee
Posts: 30
Registered: ‎09-17-2013

Re: message:Unauthorized for Solr After Kerberos Enabled