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 though. At that point, Zookeeper will eventually tryto contact
the Solr node and, if the Solr node is unavailable, remove it's
ephemeral node from the live_nodes znode. It does _not_, however,
change any replica's states that are hosted on that Solr instance,
thus you must check live_nodes too.

Or shut Solr down gracefully. This may require that you lengthen
"SOLR_STOP_WAIT" in solr.in.sh (Solr 6.3). If your version is earlier
than 6.3, you'll have to modify your local copy of bin/solr.

Best,
Erick.

On Sun, Jun 10, 2018 at 8:11 AM, yy lee <solryy...@gmail.com> wrote:
> 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

Reply via email to