[ 
https://issues.apache.org/jira/browse/SOLR-8216?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14976963#comment-14976963
 ] 

Shawn Heisey commented on SOLR-8216:
------------------------------------

[~risdenk], the basic problem with node-specific requests in a SolrCloud 
context is that you do not know which node will be selected by CloudSolrClient.

In order to guarantee which node(s) I'm talking to, I would do this with 
HttpSolrClient.  Create an instance of that object for each Solr that you're 
running.  Here's some sample code:

{code}
  SolrClient sysClient = new HttpSolrClient("http://server:port/solr";);
  SolrQuery sysQuery = new SolrQuery();
  sysQuery.setRequestHandler("/admin/info/system");
                
  QueryResponse rsp = sysClient.query(sysQuery);
  String os = (String) rsp.getResponse().findRecursive("system", "name");
  String ver = (String) rsp.getResponse().findRecursive("system", "version");
  System.out.println("OS: " + os + " " + ver);
{code}


> CloudSolrClient cannot query /admin/info
> ----------------------------------------
>
>                 Key: SOLR-8216
>                 URL: https://issues.apache.org/jira/browse/SOLR-8216
>             Project: Solr
>          Issue Type: Bug
>          Components: SolrJ
>    Affects Versions: 5.4, 5.3.1, Trunk
>            Reporter: Kevin Risden
>         Attachments: SOLR-8216.patch, SOLR-8216.patch
>
>
> I am trying to use CloudSolrClient to query information about the Solr server 
> including version information. I found /admin/info/system and it seems to 
> provide the information I am looking for. However, it looks like 
> CloudSolrClient cannot query /admin/info since INFO_HANDLER_PATH [1] is not 
> part of the ADMIN_PATHS in CloudSolrClient.java [2]. Was this possibly missed 
> as part of SOLR-4943?
> As a side note, ZK_PATH also isn't listed in ADMIN_PATHS. I'm not sure what 
> issues that could cause. Is there a reason that ADMIN_PATHS in 
> CloudSolrClient would be different than the paths in CommonParams [1]?
> [1] 
> https://github.com/apache/lucene-solr/blob/trunk/solr/solrj/src/java/org/apache/solr/common/params/CommonParams.java#L168
> [2] 
> https://github.com/apache/lucene-solr/blob/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java#L808



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to