Class HealthCheckHandler

  • All Implemented Interfaces:
    AutoCloseable, ApiSupport, SolrInfoBean, NestedRequestHandler, SolrMetricProducer, SolrRequestHandler

    public class HealthCheckHandler
    extends RequestHandlerBase
    Health Check Handler for reporting the health of a specific node.

    By default the handler returns status 200 OK if all checks succeed, else it returns status 503 UNAVAILABLE:

    1. Cores container is active.
    2. Node connected to zookeeper.
    3. Node listed in live_nodes in zookeeper.

    The handler takes an optional request parameter requireHealthyCores=true which will also require that all local cores that are part of an active shard are done initializing, i.e. not in states RECOVERING or DOWN. This parameter is designed to help during rolling restarts, to make sure each node is fully initialized and stable before proceeding with restarting the next node, and thus reduce the risk of restarting the last live replica of a shard.