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/XXXX.in.sh, 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 collections.

> 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.

https://lucene.apache.org/solr/guide/6_6/collections-api.html#CollectionsAPI-create

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.

Thanks,
Shawn

Reply via email to