/ factorpad.com / tech / solr / reference / solr-healthcheck.html
An ad-free and cookie-free website.
Beginner
Developing capabilities in the search for sites space can get confusing. Offerings include a managed SAAS search offering like Google custom search or Amazon CloudSearch, among others. Others prefer to build custom search a solr web offering or Elasticsearch search capabilities on top of Apache Lucene libraries.
Either way, search is moving to the cloud and Apache SolrCloud offering
is what sits behind many offerings, so getting up to speed with how
search in the cloud is managed is a necessity. The
solr healthcheck
command offers a
fast way to see all of the different nodes, shards, replicas and
collections so you can monitor the health of your SolrCloud search
service quickly.
The solr healthcheck
command will
report on all active collections on the SolrCloud server as specified
by collection or by host and port number.
The solr healthcheck
command is one of
12 commands within the main solr
script.
The solr healthcheck
command itself has 2
options, also known as parameters.
The syntax for running solr healthcheck
is as follows.
The list of 2 options including default values are explained in the table below.
This syntax assumes your current working directory is
the $SOLR_HOME directory for Solr, which for version 7
would be ~/solr-7.0.0/
in
standalone mode for a local installation. When running in a production
environment the directory locations may differ.
So the path to the location of the solr script is:
~/solr-7.0.0/bin/solr
. Alternatively,
the solr
script can be run using the
convention ./solr
from within
the bin
directory.
When using Windows, the solr script is called using
solr.cmd
.
For the solr healthcheck
command the
-c <collection>
option
(parameters) is required. Other options are optional.
Syntax | Purpose | Default |
---|---|---|
-c <collection> |
Print a JSON-formatted report on a SolrCloud collection. | A collection is required |
-z <zkHost> |
Connect to an existing Zookeeper instance in SolrCloud mode. ZooKeeper instances are often started on the default port (8983) plus 1000, or 9983. | localhost:9983 |
Below is a list of items reported in JSON format when using the
bin/solr healthcheck
command in
SolrCloud mode on the collection specified.
For each shard identified above the healthcheck provides the following information.
For each replica the following information is reported in JSON format.
The following command will run a healthcheck on an established and running SolrCloud instance with a collection named mycollection.
The following command runs a healthcheck on a collection called mycollection on a non-default port 9984.
From the command line you can access additional help on the Solr
healthcheck command by appending
-help
after the command.
FactorPad offers Apache Solr Search content in both tutorials and reference.
The learning never stops, please join us at our YouTube Channel and follow @factorpad.
/ factorpad.com / tech / solr / reference / solr-healthcheck.html
A newly-updated free resource. Connect and refer a friend today.