Re: Get replica status in solrj

2018-06-11 Thread y y
after I close down one of the solr without using the stop command, I can get the correct replica state as "down" in the command prompt using this code: solr.cmd healthcheck -c test1 -z localhost:2181,localhost:2182,localhost:2183 but I cannot get the correct replica state in solrj even when I add t

Re: Get replica status in solrj

2018-06-11 Thread Erick Erickson
bq. how can I get the correct replica state? something like add this additional test. if (reader..getClusterState().getLiveNodes().contains(replica.getNodeName()) == false) state is down. Best, Erick On Mon, Jun 11, 2018 at 6:59 AM, Shawn Heisey wrote: > On 6/11/2018 3:29 AM, y y wrote: >>

Re: Get replica status in solrj

2018-06-11 Thread Shawn Heisey
On 6/11/2018 3:29 AM, y y wrote: question is I can manage to get the correct replica state if I start and stop solr using command line. how if solr failure or crashed, how can I get the correct replica state? As I have stated elsewhere on this mailing list, actual Solr crashes are extremely

Re: Get replica status in solrj

2018-06-11 Thread y y
Hi all, I am using the code below to get the replica state: ZkStateReader reader = cloudSolrClient.getZkStateReader(); ClusterState slices22 = reader.getClusterState(); DocCollection slices = reader.getClusterState().getCollection(collection); Iterator iter = slices.iterator();

Re: Get replica status in solrj

2018-06-10 Thread Erick Erickson
You have to cross check with live_nodes. This is especially true if you stop Solr un-gracefully, i.e. "kill -9" or the like (which is _not_ recommended). During graceful shutdown, the Solr instance has a chance to change all replica's states correctly. There's no chance to do that if you kill Solr

Get replica status in solrj

2018-06-10 Thread yy lee
hi all, I am try to get the replica status from solrj, but I found out that the status I get is not correct. I still get the state of the replica as "active", although I have stop my solr. Is there any way I can get the correct replica state from solrj? regards, yy