Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Solr configuration and setup under Git source control

I've got Solr running as a service on windows. I used NSSM (http://nssm.cc/) to set up the service to automatically start. The web server is Jetty.

I'd like to have my Solr directory under source control in Git because the configuration changes (and sometimes plugin changes) need to be picked up by all team members. At the very least, I'd like to have the configuration files (solrconfig.xml, schema.xml, stopwords.txt, etc.) under Git control, but ideally, I'd like to put the whole solr directory (including jar and war files) under Git control. Will this pose any problems? I can foresee us pulling commits and switching branches, all while the Solr service is running.

How have other teams configured Solr under source control?

like image 541
Johnny Oshika Avatar asked Mar 21 '26 17:03

Johnny Oshika


1 Answers

The rule I go by is to check in configuration files (SolrConfig.xml, Stopwords.txt, dataconfig.xml etc.)

There are reasons, IMHO, to not check in the entire Solr directory in source control:

  • Solr directory contains the index data as well as configuration. Bad idea to check in the index, because
    1. size of the repo will grow
    2. your index isn't a data-source. In most cases, it relies on external source such as RDBMS to refresh itself. Huge risk on data-integrity when your database goes out of sync with your Solr Index.
  • Only in development box, we have Solr and the consuming app deployed in the same machine, otherwise, setting up Solr is independent of application deploy. Checkin in Solr directory in SC would mean unnecessarily big repositories to deploy.

Rather than doing the whole repository checkin, we ended up having the config files checked in and basic scripts to setup solr, create index, start an instance etc. So every team member could check out the code base, run a couple of build tasks and get ready to party :)

like image 195
Srikanth Venugopalan Avatar answered Mar 24 '26 07:03

Srikanth Venugopalan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!