FactorPad
Faster Learning Tutorials

The Solr stop command syntax and examples

This command has few options and should be secured in a production environment.
  1. About - understand the purpose of the stop command.
  2. Syntax - see solr stop command usage from the command line.
  3. Options - view 4 options used with the solr stop 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 stop


The solr stop command

Beginner

Recently, many developers are evaluating alternatives to Google Custom Search or Amazon CloudSearch. The Apache Lucene library with front-end tools from Apache Solr and Elasticsearch provide alternatives for those looking to create a website search engine or expand their enterprise search capabilities.

During this evaluation period, typically in a local test environment, developers need to stop Solr. The solr stop command offers a fast way to stop the Solr service using a short list of settings.

Apache Solr Reference

1. About the solr stop command

The solr stop command will stop the Solr server as specified. It is a good idea to use the solr status command first to review the running instances of Solr.

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

The solr stop command itself has 4 options, also known as parameters.

2. Syntax for the solr stop command

The syntax for running solr stop is as follows.

$ bin/solr stop [-k key] [-p port] [-all] [-V]

The list of 4 options including default values are noted 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.

3. Options for the solr stop command

For the solr stop command the following options (parameters) are optional.

Syntax Purpose Default
bin/solr stop without options Stop Solr with default options. If one instance is running it will stop. For multiple instances it will prompt the user to specify the port number to stop.
-k <key> Secure the stop command with the key password solrrocks. solrrocks
-p <port> Stop a Solr instance on a specific port number. None
-all Stop all Solr server instances running on the host. None
-V Provide verbose messaging about actions taken from the bin/solr script None

4. Examples of the solr stop command

Example 1 - Stop Solr using a key

The following command will stop solr using the specified key solrrocks.

$ bin/solr stop -k solrrocks
Example 2 - Stop Solr instance on port 8984

The following command stops Solr only on port 8984.

$ bin/solr stop -p 8984
Example 3 - Stop all instances of Solr

The following command will stop all instances of Solr on the host.

$ bin/solr stop -all
Example 4 - Stop Solr and provide verbose messages

The following command will stop Solr and provide verbose messages of each step.

$ bin/solr stop -V
Example 5 - Print additional help on the solr stop command

From the command line you can access additional help on the stop command by appending -help after the command.

$ bin/solr stop -help

Other Related Solr Content

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


What's Next?

Our YouTube Channel is growing and we would love for you to be part of it. Subscribe here.

  • To see the outline of Solr reference material, click Outline.
  • To learn about starting Solr, click Back.
  • To learn about how to restart Solr, click Next.

Outline Back Next

~/ home  / tech  / solr  / reference  / solr stop



 
 
Keywords:
solr reference
apache solr
solr search
website search
enterprise search
apache lucene
lucene reference
solr examples
solr commands
solr syntax
solr help
solr stop
google site search
solr settings
solr configuration
man page