On 6/29/2018 3:26 PM, Zimmermann, Thomas wrote:
> We're transitioning from Solr 4.10 to 7.x and working through our options 
> around managing our schemas. Currently we manage our schema files in a git 
> repository, make changes to the xml files,

Hopefully you've got the entire config in version control and not just
the schema.

> and then push them out to our zookeeper cluster via the zkcli and the 
> upconfig command like:
>
> /apps/solr/bin/zkcli.sh -cmd upconfig -zkhost host.com:9580 -collection core 
> -confname core -confdir /apps/solr/cores/core/conf/ -solrhome /apps/solr/

I don't think the collection parameter is valid for that command.  It
would be valid for the linkconfig command, but not for upconfig.  It's
probably not hurting anything, though.

> This allows us to deploy schema changes without restarting the cluster, while 
> maintaining version control. It looks like we could do the exact same process 
> using Solr 7 and the solr control script like
>
> bin/solr zk upconfig -z 111.222.333.444:2181 -n mynewconfig -d 
> /path/to/configset

Yes, you can do it that way.

> Now of course we'd like to improve this process if possible, since manually 
> pushing schema files to the ZK server and reloading the cores is a bit 
> command line intensive. Does anyone has any guidance or experience here 
> leveraging the managed schema api to make updates to a schema in production 
> while maintaining a version controlled copy of the schema. I'd considered 
> using the api to make changes to our schemas, and then saving off the 
> generated schema api to git, or saving off a script that creates the schema 
> file using the managed api to git, but I'm not sure if that is any easier or 
> just adds complexity.

My preferred method would be manual edits, pushing to git, pushing to
zookeeper, and reloading the collection.  I'm comfortable with that
method, and don't know much about the schema API.

If you're comfortable with the schema API, you can use that, and then
use the "downconfig" command on one one of the ZK scripts included with
Solr for pushing to git.

Exactly how to handle the automation would depend on what OS platforms
are involved and what sort of tools are accessible to those who will be
making the changes.  If it would be on a system accessed with a
commandline shell, then a commandline script (perhaps a shell script)
seems like the best option.  A script could be created that runs the
necessary git commands and then the Solr script to upload the new
config, and it could even reload the collection with a tool like curl.

Thanks,
Shawn

Reply via email to