如何使用CloudSolrClient通过Zookeeper正确提供用于查询solrcloud的凭据?

时间:2019-08-22 19:01:28

标签: java solr solrj solrcloud

我正在尝试使用连接到zookeeper主机的CloudSolrClient查询solrcloud。

我目前正在通过请求中的基本身份验证提供Zookeeper凭证,从而收到KeeperException $ NoAuthException。 Zookeeper和Solrnodes都受到保护,但是它们使用不同的凭据。如何克服当前错误,并正确提供凭据以得到响应?

SolrClient solrClient = new CloudSolrClient.Builder(zkUrls, Optional.empty()).build();
SolrQuery solrQuery = new SolrQuery();

solrQuery.setRequestHandler(FIELD_LIST_HANDLER);
QueryRequest req = new QueryRequest(solrQuery);
req.setBasicAuthCredentials(zkUser, zkPassword);
QueryResponse response = req.process(solrClient, core);
  

2019-08-22 11:18:25-错误caafajsc.trace.aop.TraceAspect [http-nio-8080-exec-1]调用JsonObject com.att.dplr.nextgen.search.service时发生异常.SolrSearchServiceImpl.getSearchResults(SearchParameterBean):org.apache.solr.common.cloud.ZooK   eeperException:   2019-08-22 11:18:25-错误caafajsc.trace.aop.TraceAspect [http-nio-8080-exec-1]调用Response com.att.dplr.nextgen.search.service.rs时发生异常。 SearchRestServiceImpl.getSearchResults(SearchParameterBean):org.apache.solr.common.cloud.Zoo   KeeperException:   2019-08-22 11:18:25-错误oaccC [。[。[。[。adnsJerseyConfiguration] [http-nio-8080-exec-1] Servlet的Servlet.service()[com.att.dplr.nextgen路径[]中的.search.JerseyConfiguration]引发了异常[org.apache.solr.common.cloud.ZooKeeperExc   根本原因   org.apache.zookeeper.KeeperException $ NoAuthException:KeeperErrorCode = / live_nodes的NoAuth       在org.apache.zookeeper.KeeperException.create(KeeperException.java:116)

0 个答案:

没有答案