Return-Path: X-Original-To: apmail-lucene-solr-user-archive@minotaur.apache.org Delivered-To: apmail-lucene-solr-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9E566111F8 for ; Thu, 4 Sep 2014 19:32:48 +0000 (UTC) Received: (qmail 11908 invoked by uid 500); 4 Sep 2014 19:32:41 -0000 Delivered-To: apmail-lucene-solr-user-archive@lucene.apache.org Received: (qmail 11838 invoked by uid 500); 4 Sep 2014 19:32:41 -0000 Mailing-List: contact solr-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: solr-user@lucene.apache.org Delivered-To: mailing list solr-user@lucene.apache.org Received: (qmail 11826 invoked by uid 99); 4 Sep 2014 19:32:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Sep 2014 19:32:40 +0000 X-ASF-Spam-Status: No, hits=0.6 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of thelabdude@gmail.com designates 209.85.220.171 as permitted sender) Received: from [209.85.220.171] (HELO mail-vc0-f171.google.com) (209.85.220.171) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Sep 2014 19:32:36 +0000 Received: by mail-vc0-f171.google.com with SMTP id id10so11277902vcb.30 for ; Thu, 04 Sep 2014 12:32:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=t381RTvDfY4UOPNF8SIBZ2ndITii+w4rqp4reO660j4=; b=mGi20XzZ7ZdH9L60kqotdhsEm84gAvNJErn6kPkBtUxHKlwMUHRJBk0RwY/ezmQmJJ suK+V0P8LMqbMStAD7YvF7X/mpmxtj9oxbr/7SvueiagQsvqKv4kbAPwMEyb0PA4f4tB W39vmJid7piYMD3OQp63ayx634S8z0p8c93S2tWbK1iwliu5EBzMk2wHpbAyACbTqQaz i1H+WqTN7mbTEonyLCjl01mdBYFV9sYqZiUmoOuLs/7scIedWK6E/88TaqgbZUAcPjRD VWquPJCDyL8ENOlIqqkvUw/3NNVDQZoSX48d0D0n14pw9pO6OPAzQzA18Rn44c2rzyPF tWsA== MIME-Version: 1.0 X-Received: by 10.220.86.72 with SMTP id r8mr6423566vcl.36.1409859135458; Thu, 04 Sep 2014 12:32:15 -0700 (PDT) Received: by 10.52.82.130 with HTTP; Thu, 4 Sep 2014 12:32:15 -0700 (PDT) In-Reply-To: <1409830640492-4156902.post@n3.nabble.com> References: <1409830640492-4156902.post@n3.nabble.com> Date: Thu, 4 Sep 2014 12:32:15 -0700 Message-ID: Subject: Re: Solr API for getting shard's leader/replica status From: Timothy Potter To: solr-user@lucene.apache.org Content-Type: text/plain; charset=UTF-8 X-Virus-Checked: Checked by ClamAV on apache.org 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 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 > > http://lucene.apache.org/solr/4_7_2/solr-solrj/index.html > > /CloudSolrServer server = new CloudSolrServer(); > ZkStateReader reader = server.getZkStateReader(); > Collection slices = reader.getClusterState().getSlices(collection); > Iterator iter = slices.iterator(); > while (iter.hasNext()) { > Slice slice = iter.next(); > 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: http://lucene.472066.n3.nabble.com/Solr-API-for-getting-shard-s-leader-replica-status-tp4156902.html > Sent from the Solr - User mailing list archive at Nabble.com.