lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Timothy Potter <>
Subject Re: Solr API for getting shard's leader/replica status
Date Thu, 04 Sep 2014 19:32:15 GMT
You need to also verify the node hosting the replica is a live node
(/live_nodes). From SolrJ, you can call:

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 Thu, Sep 4, 2014 at 4:37 AM, manohar211 <> wrote:
> 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.
> <>
> Our production environment doesn't provide access to this Admin UI due to
> security reasons. I need to provide an API to get the status of each and
> every collection, and its shards and each shard's replica. I am using Solr
> APIs to do that
> /CloudSolrServer server = new CloudSolrServer(<zk quorum>);
> ZkStateReader reader = server.getZkStateReader();
> Collection<Slice> slices = reader.getClusterState().getSlices(collection);
> Iterator<Slice> iter = slices.iterator();
> while (iter.hasNext()) {
>     Slice slice =;
>     System.out.println(slice.getName());
>     System.out.println(slice.getState());
> }/
> The above piece of code is always returning Active only as the state of
> shard, even its replica is showing down in the UI. I assume this returns
> only the state of a shard, not the state of shard's leader or replica.
> How can I get the replicas status through Solr APIs? is there any API for
> this? And what is the API being using by Solr Admin UI for getting shard's
> replicas/leader status?
> Thanks
> --
> View this message in context:
> Sent from the Solr - User mailing list archive at

View raw message