/ factorpad.com / tech / solr / reference / solr-start.html
An ad-free and cookie-free website.
Beginner
Whether you are evaluating Apache Solr versus Elasticsearch for your
website search or enterprise search needs, you will need to start
Apache Solr search from command line to begin. The
solr start
command offers a fast way
to start the solr service using a variety of settings.
The solr start
command will start
Solr with settings such as foreground or background, cloud or
standalone mode, ports, configuration file directories, examples data
sets and memory allocations. So it is one of the most important and
frequently used commands.
The solr start
command is one of 12
commands within the main solr
script.
The solr start
command itself has 12
options, also known as parameters.
The syntax for running solr start
is
as follows.
The list of 12 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
.
For the solr start
command all 12
options (parameters) are optional.
Syntax | Purpose | Default |
---|---|---|
bin/solr start without options |
Start Solr with default options. |
|
-f |
Start Solr in the foreground. This cannot be paired with the -e option to open an example data set. | Start Solr in background mode |
-c or
-cloud |
Start Solr in SolrCloud mode. It is common to also include the -z option. | If -z is not supplied then a Zookeeper instance is started on the default port (8983) plus 1000, or 9983. |
-h <host> |
Indicate a hostname for the Solr instance so HTTP requests can
be sent through a browser to http://<host>:<port> to access the Solr Admin User Interface. |
localhost |
-p <port> |
Set the port where Solr will listen for HTTP requests. | Port 8983 |
-d <dir> |
Specify the location of the server directory where core configurations and indexes are stored. It is more common to adjust the -s option one step lower in the $SOLR_HOME/server/solr directory in some use cases. | $SOLR_HOME/server |
-z <zkHost> |
Connect to an existing Zookeeper instance when initiating with the -c or -cloud option in SolrCloud mode. | Create a new embeded Zookeeper instance |
-m <memory> |
Sets the minimum and maximum amount of memory allocated to the the Java Virtual Machine. Using one value sets both minimum (-Xms) and maximum (-Xmx) at the same level. Sizes are given in m for megabytes and g for gigabytes. | 512m, or 512 megabytes |
-s <dir> |
Initiates a system property called solr.solr.home which is where solr core directories are installed. Solr will look for a solr.xml file in that directory, unless one is located in Zookeeper. This is ignored when using -e to start an example data set. | $SOLR_HOME/server/solr |
-e <example> |
Select the name of an example data set to start. Currently there
are four data sets.
|
None |
-a |
To pass additional parameters to the Java Virtual Machine on startup for more advanced setups. These are typically included within double quotes. | None |
-j |
To pass additional parameters to Jetty on startup for more advanced setups. These are typically included within double quotes. | None |
-noprompt |
Do not prompt for user input and accept defaults where interaction would otherwise be required. | Prompt the user |
-v |
Set verbose mode (DEBUG) for logging, common in a development environment. | Log level set to INFO |
-q |
Set quiet mode (WARN) for logging, common in a production environment where only warnings and errors are logged. | Log level set to INFO |
-V |
Provide verbose messaging about actions taken from the bin/solr script. | Run silent |
-force |
To silence a warning message when Solr is started by the root user. Using root may cause issues. | To exit with a warning |
The following command runs Solr with the example data set called techproducts including its default configuration files.
The following command will start Solr on port number 8984 instead of on the default 8983.
The following command will start Solr with the hostname set to search.example.com.
The following command will start Solr with 2 Gigabytes of memory.
The following command will start Solr with messages from the bin/solr script itself.
From the command line you can access additional help on the start
command by appending
-help
after the command.
FactorPad offers Apache Solr Search content in both tutorials and reference.
Connect for more free learning content and to join a group of smart people like you.
/ factorpad.com / tech / solr / reference / solr-start.html
A newly-updated free resource. Connect and refer a friend today.