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 this
additional test code :
" if (reader..getClusterState().getLiveNodes().contains(
replica.getNodeName())
== false) ----state is down."
it is because of ".... live_nodes and the clusterstate will not be updated
immediately...." as mentioned above?

regards,
yy

On Mon, Jun 11, 2018 at 11:03 PM, Erick Erickson <erickerick...@gmail.com>
wrote:

> 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 <elyog...@elyograg.org>
> wrote:
> > 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 rare.  The most common reason for Solr to die suddenly is the
> > intentional death that happens when OutOfMemoryError is thrown.  Other
> > causes are possible, but normally indicate serious problems with the
> system
> > itself.
> >
> > If Solr is ungracefully killed due to OOME or some other reason, then as
> > Erick mentioned, live_nodes and the clusterstate will not be updated
> > immediately.  Eventually, when attempts to use those replicas fail, the
> > remaining Solr servers will notice that the node is down and update the
> > clusterstate.  But it won't happen as soon as the node dies.
> >
> > Thanks,
> > Shawn
> >
>

Reply via email to