Thanks Shawn, it all mainly made sense.

I took the hint and looked at both solr.in.cmd and solr.in.sh.  Clearly setting 
ZK_HOST is a first step.  I am sure this is explained somewhere, but I 
overlooked it.
From here, once I have Solr installed, I can run the Control Script to upload a 
config set either when creating a collection or independent of creating the 
collection.

When I install Solr on the three nodes I have planned, I run the Control Script 
and just point to somewhere on disk I have the config set stored.

One question buried in my first missive was about mixing the Solr machines.  I 
was thinking of installing Solr on two VM's running Centos and then make my 
third Solr node on my local machine, i.e. Windows.  I can't think of why this 
could be an issue,  as long as everything is setup with the right ZK hosts, 
etc.  Does anyone know of any potential issues doing this?

One last clarification.  

Per, " The definition wouldn't come from the running Solr, it would come from 
the *config* that started the running Solr."

I am not sure what "definition" and *config* are referencing.  When I initially 
install Solr it will not have a config set.  I haven't created a Collection 
yet.   The running Solr instance upon initial install has no config yet.  But, 
I think I am not understanding what "definition" and "*config*" mean.

Thanks in advance.


-S


On 11/29/2017 11:44 AM, Steve Pruitt wrote:
> I want ZK to manage the config files.  The config set and the solr.xml file.  
> I wanted to upload them explicitly.
>
> This is where my questions begin.
> I assume I upload the config files prior to starting Solr?

If you're storing solr.xml in ZK, then you need to upload that file before 
starting Solr.  Note that you cannot have server-specific configurations in 
solr.xml if it is in zookeeper -- the exact same solr.xml file will be used for 
all Solr instances connecting to that ZK ensemble.

You can upload the collection configurations either before or after you start 
Solr, but they definitely need to be there before you create collections that 
use them.

> Since I have Solr installed on locally, I can use the local scripts to upload 
> the config files?
> Looking at the example command for uploading the solr.xml file.
>
>     bin/solr zk cp file:local/file/path/to/solr.xml zk:/solr.xml -z 
> localhost:2181
>       
> It lists a single ZK host (example localhost). If uploading to a ZK ensemble, 
> do I list all three hosts as in my case?
> Or, do I send it to one ZK host and ZK makes it available to the other ZK 
> hosts?

I would personally include the entire zkhost string listing all your servers 
and any chroot.  But if you only list one (and the chroot if you're using one), 
then it will *probably* work without any problems. The connection is only 
needed for a few moments with the commandline copies.

> Looking at the example command for uploading the configuration files.
>
>     bin/solr zk upconfig -n <name for configset> -d <path to directory 
> with configset>
>        
> I see no ZK hosts listed.  I assume this means Solr has been started in cloud 
> mode and already knows the ZK hosts?

The definition wouldn't come from the running Solr, it would come from the 
*config* that started the running Solr.

It would take an exhaustive code review to be SURE about what I'm going to say 
here, but this is how I *think* it works:  If the -z option is not provided, 
the bin/solr script is going to expect ZK_HOST to be defined in the environment 
or the include script.  If you have
*installed* Solr (rather than just extracted the archive and started it), then 
the include script is going to be in /etc/default and will typically be named 
solr.in.sh, but the name could be different if you changed the name of the 
service when you installed it.  If you have just started Solr manually, then it 
will probably be bin/solr.in.sh.

If you have defined ZK_HOST in your include script, then you probably don't 
need the -z option for the solr.xml copy command above either.

If what I've just said is correct, then I can be reasonably sure it's the case 
for 6.6.x and 7.x, but I do not know for sure with older versions.

> Per the solr.xml file.  When installing Solr, I can leave installed solr.xml 
> file in place?  ZK replaces it with the uploaded version?

As I understand it, if Solr finds solr.xml in zookeeper on startup, it is going 
to use that file, and won't even look for a local copy.

Thanks,
Shawn

Reply via email to