Re: Solr API for getting shard's leader/replica status

2014-09-08 Thread Jeff Wartes
I had a similar need. The resulting tool is in scala, but it still might be useful to look at. I had to work through some of those same issues: https://github.com/whitepages/solrcloud_manager From a clusterstate perspective, I mostly cared about active vs non-active, so hereĀ¹s a sample output

Re: Solr API for getting shard's leader/replica status

2014-09-05 Thread manohar211
Thanks for the comments!! I found out the solution on how I can get the replica's state. Here's the piece of code. while (iter.hasNext()) { Slice slice = iter.next(); for(Replica replica:slice.getReplicas()) { System.out.println(replica state for +

Solr API for getting shard's leader/replica status

2014-09-04 Thread manohar211
Solr has a Admin UI where we can check each and every Collections that were deployed to Solr Cloud. For example, I can see a Slice/Shard in a collection up or not in the mentioned diagram. http://lucene.472066.n3.nabble.com/file/n4156902/cloud-graph.png Our production environment doesn't

Re: Solr API for getting shard's leader/replica status

2014-09-04 Thread Timothy Potter
You need to also verify the node hosting the replica is a live node (/live_nodes). From SolrJ, you can call: clusterState.getLiveNodes().contains(node). As for API, there is CLUSTERSTATE provided by the Collection API, but it's not consulting /live_nodes (which is a bug) - I'll open a ticket. On

Re: Solr API for getting shard's leader/replica status

2014-09-04 Thread Timothy Potter
https://issues.apache.org/jira/browse/SOLR-6481 On Thu, Sep 4, 2014 at 12:32 PM, Timothy Potter thelabd...@gmail.com wrote: You need to also verify the node hosting the replica is a live node (/live_nodes). From SolrJ, you can call: clusterState.getLiveNodes().contains(node). As for API,