lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Snead, Ryan [USA]" <Snead_R...@bah.com>
Subject Giving SolrJ credentials for Zookeeper
Date Tue, 26 Feb 2019 17:56:32 GMT
I am following along with the example found in Zookeeper Access Control of the Apache Solr
7.5 Reference Guide. I have gotten to the point where I can use the zkcli.sh control script
to access my secured Zookeeper environment. I can also connect using Zookeeper's zkCli.sh
and then authenticate using the auth command. The point where I run into trouble is having
completed the steps in the article, how do I find what parameters to set with SolrJ to allow
my indexer code to communicate with Zookeeper.

The error my Java code is returning when I try to process a QueryRequest is: Error reading
cluster properties from zookeeper org.apache.zookeeper.KeeperException$NoAuthException: KeeperError
Code = NoAuth for /clusterprops.json

My code is:
solrClient = new CloudSolrClient.Builder("localhost:2181", Optional.of("/")).build();
String solrQuery = String.format("PRODUCT_TYPE:USER and PRODUCT_SK:%s", productSk);
SolrQuery q = new SolrQuery();
q.set("q", solrQuery);
QueryRequest request = new QueryRequest(q);
numfound = request.process(solrClient).getResults().getNumFound();
Error occurs at the last line. I suspect that I need to set a property in solrClient, but
it is not clear to me what that would be.

References:
https://lucene.apache.org/solr/guide/7_5/zookeeper-access-control.html
ZooKeeper Access Control | Apache Solr Reference Guide 7.5<https://lucene.apache.org/solr/guide/7_5/zookeeper-access-control.html>
Content stored in ZooKeeper is critical to the operation of a SolrCloud cluster. Open access
to SolrCloud content on ZooKeeper could lead to a variety of problems.
lucene.apache.org



Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message