FactorPad
Faster Learning Tutorials

The Solr status command syntax and examples

This command prints JSON-formatted output of settings for each running Solr instance, providing a quick way to get acquainted.
  1. About - understand the purpose of the status command.
  2. Syntax - see solr status command usage from the command line.
  3. Options - view options and output from the solr status command.
  4. Examples - review several common examples including additional help.
by Paul Alan Davis, CFA, October 12, 2017
Updated: July 15, 2018
Here we focus on the command line using a Linux-based operating system, however many of the same commands work for macOS. There are slight differences for Windows.

Outline Back Next

~/ home  / tech  / solr  / reference  / solr status


The solr status command

Beginner

As we build out custom search applications and evaluate Apache Solr search versus Elasticsearch it is important to learn about server instances and configurations quickly. This command allows you to do just that. The solr status command offers a fast way to learn about modes, nodes, clusters, replicas, cores and collections while offering locations of important files.

Apache Solr Reference

1. About the solr status command

The solr status command will poll the Solr server for running processes and generate a report summarizing all of the locations and settings. One of the unique aspects of the status command is that it has no options. If no instances are running it will provide a message and exit. If instances are running it will provide a report and exit. So it is very limited in its functionality, but provides helpful information quickly.

The solr status command is one of 12 commands within the main solr script.

The solr status command itself has no options. Everything after the command itself is ignored, meaning you cannot run a status report only on a specific port.

2. Syntax for the solr status command

The syntax for running solr status is as follows.

$ bin/solr status

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.

If Solr Windows is your preferred environment for custom search, the solr script is called using solr.cmd.

3. Options for the solr status command

The solr status command takes no options (parameters). It simply polls for running Solr server instances and presents a JSON-formatted report of settings.

Syntax Purpose Default
bin/solr status Provide a status of running Solr instances. No options
Items reported in a status report

Below is a list of items reported in JSON format when using the bin/solr status command in standalone (one server) mode.

  • Solr process - the process ID on the system
  • port - the port running the Solr instance
  • version - the Solr version number
  • startTime - the date and time the server started
  • uptime - the time since the server started
  • memory - the used and allocated memory

The following additional items are reported when Solr is run in SolrCloud mode.

  • cloud - a grouping of data items relevent to SolrCloud mode
  • ZooKeeper - the hostname and port of the Zookeeper server
  • liveNodes - the number of nodes on the server
  • collections - the number of collections associated with the SolrCloud service running on that server port

4. Examples of the solr status command

Example 1 - The Solr status when no nodes are present

As mentioned earlier, if no instances of Solr are present then you will see a message and the script will exit.

$ bin/solr status No Solr nodes are running.
Example 2 - Find help on the Solr status command

The status command does not have a traditional help similar to a man page for other commands. Any text entered after the command will be ignored and Solr will poll for instances and provide a report, if any instances are present.

$ bin/solr status -help No Solr nodes are running.
Example 3 - Start a Solr instance and access its status

The following commands will start a basic solr instance in standalone mode using default settings and then report its status.

$ bin/solr start Waiting up to 180 seconds to see Solr running on port 8983 [\] Started Solr server on port 8983 (pid=5700). Happy searching! $ bin/solr status { "solr_home":"/home/paul/solr-7.0.0/server/solr", "version":"7.0.0 3ba304b29825a94249c5145b3f5061e87b87d8f8 - anshum - 2017-09-08 13:21:08", "starttime":"2017-10-11T16:16:15.224Z", "uptime":"0 days, 0 hours, 4 minutes, 9 seconds", "memory":"30.4 MB (6.2%) of 490.7 MB"}

Other Related Solr Content

FactorPad offers Apache Solr Search content in both tutorials and reference.


What's Next?

Subscribe to our YouTube Channel for more free opportunities to learn.

  • To see the outline of Solr reference material, click Outline.
  • To learn about restarting Solr, click Back.
  • To learn how to run a Solr healthcheck, click Next.

Outline Back Next

~/ home  / tech  / solr  / reference  / solr status



 
 
Keywords:
solr reference
apache solr
solr search
custom search
enterprise search
apache lucene
lucene reference
solr examples
solr commands
solr syntax
solr help
elasticsearch
solr status
google site search
solr settings
solr configuration
man page