Skip to content

Instantly share code, notes, and snippets.

@janhoy
Last active March 12, 2025 19:05
Show Gist options
  • Save janhoy/070451cbdaaf576ddd200a866d435771 to your computer and use it in GitHub Desktop.
Save janhoy/070451cbdaaf576ddd200a866d435771 to your computer and use it in GitHub Desktop.
Solr start usage
Usage: solr start [-f] [--user-managed] [--host host] [-p port] [--server-dir directory] [-z zkHost] [-m memory]
[-e example] [--solr-home solr.solr.home] [--data-home solr.data.home] [--jvm-opts "jvm-opts"] [--verbose]
-f/--foreground Start Solr in foreground; default starts Solr in the background
and sends stdout / stderr to solr-PORT-console.log
--user-managed Start Solr in user managed aka standalone mode
See the Ref Guide for more details: https://solr.apache.org/guide/solr/latest/deployment-guide/cluster-types.html
--host <host> Specify the hostname for this Solr instance
-p/--port <port> Specify the port to start the Solr HTTP listener on; default is 8983
The specified port (SOLR_PORT) will also be used to determine the stop port
STOP_PORT=($SOLR_PORT-1000) and JMX RMI listen port RMI_PORT=($SOLR_PORT+10000).
For instance, if you set -p 8985, then the STOP_PORT=7985 and RMI_PORT=18985
--server-dir <dir> Specify the Solr server directory; defaults to server
-z/--zk-host <zkHost> Zookeeper connection string; ignored when running in User Managed (--user-managed) mode.
If neither ZK_HOST is defined in solr.in.sh nor the -z parameter is specified,
an embedded ZooKeeper instance will be launched.
Set the ZK_CREATE_CHROOT environment variable to true if your ZK host has a chroot path, and you want to create it automatically.
-m/--memory <memory> Sets the min (-Xms) and max (-Xmx) heap size for the JVM, such as: -m 4g
results in: -Xms4g -Xmx4g; by default, this script sets the heap size to 512m
--solr-home <dir> Sets the solr.solr.home system property; Solr will create core directories under
this directory. This allows you to run multiple Solr instances on the same host
while reusing the same server directory set using the --server-dir parameter. If set, the
specified directory should contain a solr.xml file, unless solr.xml exists in Zookeeper.
This parameter is ignored when running examples (-e), as the solr.solr.home depends
on which example is run. The default value is server/solr. If passed relative dir,
validation with current dir will be done, before trying default server/<dir>
--data-home <dir> Sets the solr.data.home system property, where Solr will store index data in <instance_dir>/data subdirectories.
If not set, Solr uses solr.solr.home for config and data.
-e/--example <name> Name of the example to run; available examples:
cloud: SolrCloud example
techproducts: Comprehensive example illustrating many of Solr's core capabilities
schemaless: Schema-less example (schema is inferred from data during indexing)
films: Example of starting with _default configset and adding explicit fields dynamically
--jvm-opts <jvmParams> Additional parameters to pass to the JVM when starting Solr, such as to setup
Java debug options. For example, to enable a Java debugger to attach to the Solr JVM
you could pass: --jvm-opts "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=18983"
In most cases, you should wrap the additional parameters in double quotes.
-j <jettyParams> Additional parameters to pass to Jetty when starting Solr.
For example, to add configuration folder that jetty should read
you could pass: -j "--include-jetty-dir=/etc/jetty/custom/server/"
In most cases, you should wrap the additional parameters in double quotes.
-y/--no-prompt Don't prompt for input; accept all defaults when running examples that accept user input
--force If attempting to start Solr as the root user, the script will exit with a warning that running Solr as "root" can cause problems.
It is possible to override this warning with the '--force' parameter.
--verbose or --quiet/-q Verbose or quiet logging. Sets default log level of Solr to DEBUG or WARN instead of INFO
Usage: solr startshort [-fhqVy] [--force] [--user-managed] [--data-home=<dataHome>] [-e=<example>] [--host=<host>]
[-j=<jettyParams>] [--jvm-opts=<jvmOpts>] [-m=<memory>] [-p=<port>] [--server-dir=<serverDir>]
[--solr-home=<solrHome>] [-z=<zkHost>]
Starts Solr in standalone or SolrCloud mode.
--data-home=<dataHome> Set solr.data.home system property for index data storage; default is solr.solr.home
-e, --example=<example> Run an example: cloud, techproducts, schemaless, films
-f, --foreground Start Solr in foreground; default is background with logs to solr-PORT-console.log
--force Override warning when attempting to start Solr as root user
-h, --help Show this help message and exit.
--host=<host> Specify the hostname for this Solr instance
-j=<jettyParams> Additional Jetty parameters, e.g., -j "--include-jetty-dir=/etc/jetty/custom/server/"
--jvm-opts=<jvmOpts> Additional JVM parameters, e.g., --jvm-opts "-verbose:gc"
-m, --memory=<memory> Set JVM heap size, e.g., -m 4g sets -Xms4g -Xmx4g; default is 512m
-p, --port=<port> Specify the Solr HTTP port; default is 8983
-q, --quiet Set log level to WARN (quiet); default is INFO
--verbose Set log level to DEBUG (verbose); default is INFO
--server-dir=<sDir> Specify the Solr server directory; default is 'server'
--solr-home=<solrHome> Set solr.solr.home system property; default is 'server/solr'. Ignored in examples mode
--user-managed Start Solr in standalone mode. Default is solrCloud (zookeeper) mode.
-V, --version Print version information and exit.
-y, --no-prompt Don't prompt for input; accept all defaults when running examples
-z, --zk-host=<zkHost> Zookeeper connection string; Default is to start an embedded ZooKeeper on PORT+10000
For a full CLI reference, see https://solr.apache.org/guide/solr/9_8/deployment-guide/solr-control-script-reference.html
Usage: solr start [-fhqVy] [--force] [--user-managed] [--data-home=<dataHome>] [-e=<example>] [--host=<host>]
[-j=<jettyParams>] [--jvm-opts=<jvmOpts>] [-m=<memory>] [-p=<port>] [--server-dir=<serverDir>]
[--solr-home=<solrHome>] [-z=<zkHost>]
Starts Solr in standalone or SolrCloud mode.
--data-home=<dataHome> Sets the solr.data.home system property, where Solr will store index data in
<instance_dir>/data subdirectories.
If not set, Solr uses solr.solr.home for config and data.
-e, --example=<example> Name of the example to run; available examples:
cloud: SolrCloud example
techproducts: Comprehensive example illustrating many of Solr's core capabilities
schemaless: Schema-less example (schema is inferred from data during indexing)
films: Example of starting with _default configset and adding explicit fields dynamically
-f, --foreground Start Solr in foreground; default starts Solr in the background and sends stdout / stderr
to solr-PORT-console.log
--force If attempting to start Solr as the root user, the script will exit with a warning that
running Solr as "root" can cause problems.
It is possible to override this warning with the '--force' parameter.
-h, --help Show this help message and exit.
--host=<host> Specify the hostname for this Solr instance
-j=<jettyParams> Additional parameters to pass to Jetty when starting Solr.
For example, to add configuration folder that jetty should read you could pass: -j
"--include-jetty-dir=/etc/jetty/custom/server/"
In most cases, you should wrap the additional parameters in double quotes.
--jvm-opts=<jvmOpts> Additional parameters to pass to the JVM when starting Solr, such as to setup Java debug
options.
For example, to enable a Java debugger to attach to the Solr JVM you could pass:
--jvm-opts "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=18983"
In most cases, you should wrap the additional parameters in double quotes.
-m, --memory=<memory> Sets the min (-Xms) and max (-Xmx) heap size for the JVM, such as: -m 4g
results in: -Xms4g -Xmx4g; by default, this script sets the heap size to 512m
-p, --port=<port> Specify the port to start the Solr HTTP listener on; default is 8983
The specified port (SOLR_PORT) will also be used to determine the stop port
STOP_PORT=($SOLR_PORT-1000) and JMX RMI listen port RMI_PORT=($SOLR_PORT+10000).
For instance, if you set -p 8985, then the STOP_PORT=7985 and RMI_PORT=18985
-q, --quiet, --verbose Verbose or quiet logging. Sets default log level of Solr to DEBUG or WARN instead of INFO
--server-dir=<serverDir>
Specify the Solr server directory; defaults to server
--solr-home=<solrHome> Sets the solr.solr.home system property; Solr will create core directories under this
directory.
This allows you to run multiple Solr instances on the same host while reusing the same
server directory set using the --server-dir parameter.
If set, the specified directory should contain a solr.xml file, unless solr.xml exists in
Zookeeper.
This parameter is ignored when running examples (-e), as the solr.solr.home depends on
which example is run.
The default value is server/solr. If passed relative dir, validation with current dir will
be done, before trying default server/<dir>
--user-managed Start Solr in user managed aka standalone mode
See the Ref Guide for more details: https://solr.apache.
org/guide/solr/latest/deployment-guide/cluster-types.html
-V, --version Print version information and exit.
-y, --no-prompt Don't prompt for input; accept all defaults when running examples that accept user input
-z, --zk-host=<zkHost> Zookeeper connection string; ignored when running in User Managed (--user-managed) mode.
If neither ZK_HOST is defined in solr.in.sh nor the -z parameter is specified,
an embedded ZooKeeper instance will be launched.
Set the ZK_CREATE_CHROOT environment variable to true if your ZK host has a chroot path,
and you want to create it automatically.
For a full CLI reference, see https://solr.apache.org/guide/solr/9_8/deployment-guide/solr-control-script-reference.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment