lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Pruitt <>
Subject RE: [EXTERNAL] - Re: starting SolrCloud nodes
Date Mon, 04 Dec 2017 14:33:57 GMT

I edited /etc/default/ to list my ZK hosts and I uncommented ZK_CLIENT_TIMEOUT leaving
the default value of 15000.
I am not sure if I need to set the SOLR_HOST.  This is not a production install, but I am
running with three ZK machines and three Solr machines in the cluster.
The comment states to use it to "exposed to cluster state".  I'm not sure what "cluster state"
means exactly and not sure if the default localhost is ok.


-----Original Message-----
From: Shawn Heisey [] 
Sent: Friday, December 01, 2017 6:34 PM
Subject: [EXTERNAL] - Re: starting SolrCloud nodes

On 12/1/2017 10:13 AM, Steve Pruitt wrote:
> Thanks to previous help.  I have a ZK ensemble of three nodes running.  I have uploaded
the config for my collection and the solr.xml file.
> I have Solr installed on three machines.
> I think my next steps are:
> Start up each Solr instance:  bin/solr start -c -z "zoo1:2181,zoo2:2181,zoo3:2181"  //
I have ZK_Hosts set to my ZK's, but the documentation seems to say I need to provide the list
here to prevent embedded ZK from getting used.

The embedded ZK will only get started if you use the -c option and there is no ZK_HOST variable
and no -z option on the commandline.

If you use both -z and ZK_HOST, then the info I've seen says the -z option will take priority. 
I haven't looked at the script closely enough to confirm, but that would be the most logical
way to operate, so it's probably correct.

If ZK_HOST is defined or you use the -z option, you do not need to include the -c option when
starting Solr.  SolrCloud mode is assumed when ZK info is available.  The only time the
-c option is *required* is when you want to start the embedded zookeeper.  Having the option
won't hurt anything, though.

To start a solr *service* in cloud mode, all you need is to add ZK_HOST to /etc/default/,
where XXXX is the service name, which defaults to solr.

> From one of the Solr instances create a collection:
> bin/solr create -c nameofuploadedconfig -s 3 -rf 2     //for example.

Nitpick:  The -c option on the create command is the name of the collection.  To specify
the name of the uploaded config, if it happens to be different from the collection name, use
the -n option.  You can use the -d option to point at a config on disk, and it will be uploaded
to a config in zookeeper named after the -n option or the collection. The collection name
and the config name are not required to match.  You can use the same config for multiple

> The documentation I think implies that all of the Solr instances are automatically set
with the collection.  There is no further action at this point?

Solr will make an automatic decision as to which nodes will be used to hold the collection. 
If you use the Collections API directly rather than the commandline, you can give Solr an
explicit list of nodes to use.  Without the explicit list, Solr will spread the collection
across the cluster as widely as it can.

The "bin/solr create" command, when used on SolrCloud, just makes an HTTP request to the Collections
API, unless you use the -d option, in which case it will upload a config to zookeeper before
calling the Collections API.


View raw message