bin/solr start -c
bin/solr start -cloud
If you specify a ZooKeeper connection string, such as , then Solr will connect to-z 192.168.1.4:2181
ZooKeeper and join the cluster. If you do not specify the -z option when starting Solr in cloud mode, then Solr will
launch an embedded ZooKeeper server listening on the Solr port + 1000, i.e., if Solr is running on port 8983,
then the embedded ZooKeeper will be listening on port 9983.
IMPORTANT: If your ZooKeeper connection string uses a chroot, such as , then youlocalhost:2181/solr
need to bootstrap the /solr znode before launching SolrCloud using the bin/solr script. To do this, you need to
use the script shipped with Solr, such as:zkcli.sh
server/scripts/cloud-scripts/zkcli.sh -zkhost localhost:2181/solr -cmd bootstrap
-solrhome server/solr
When starting in SolrCloud mode, the interactive script session will prompt you to choose a configset to use.
For more information about starting Solr in SolrCloud mode, see also the section .Getting Started with SolrCloud
Running with Example Configurations
bin/solr start -e <name>
The example configurations allow you to get started quickly with a configuration that mirrors what you hope to
accomplish with Solr.
Each example launches Solr in with a managed schema, which allows use of the to make schemaSchema API
edits, but does not allow manual editing of a Schema file If you would prefer to manually modify a fischema.xml
le directly, you can change this default as described in the section .Schema Factory Definition in SolrConfig
Unless otherwise noted in the descriptions below, the examples do not enable nor .SolrCloud schemaless mode
The following examples are provided:
cloud: This example starts a 1-4 node SolrCloud cluster on a single machine. When chosen, an
interactive session will start to guide you through options to select the initial configset to use, the number
of nodes for your example cluster, the ports to use, and name of the collection to be created. When using
this example, you can choose from any of the available configsets found in $SOLR_HOME/server/solr
./configsets
techproducts: This example starts Solr in standalone mode with a schema designed for the sample
documents included in the directory. The configset used can be$SOLR_HOME/example/exampledocs
found in .$SOLR_HOME/server/solr/configsets/sample_techproducts_configs
dih: This example starts Solr in standalone mode with the DataImportHandler (DIH) enabled and several
example files pre-configured for different types of data supported with DIH (such as,dataconfig.xml
database contents, email, RSS feeds, etc.). The configset used is customized for DIH, and is found in $SO
. For more information about DIH, see the section LR_HOME/example/example-DIH/solr/conf Uploa
.ding Structured Data Store Data with the Data Import Handler
schemaless: This example starts Solr in standalone mode using a managed schema, as described in the
section , and provides a very minimal pre-defined schema. SolrSchema Factory Definition in SolrConfig
will run in with this configuration, where Solr will create fields in the schema on the flySchemaless Mode
and will guess field types used in incoming documents. The configset used can be found in $SOLR_HOME
./server/solr/configsets/data_driven_schema_configs
Stop
The run-in-foreground option (-f) does not work with the -e option since the script needs to perform
additional tasks after starting the Solr server.