...
Find a suitable location to install Solr4. On IST VMs, this is
/usr/local/share
. On other systems, it can be most anywhere you like (provided you have write access to the directory, of course!). These instructions mostly assume solr's home is/usr/local/share
. So... change to the directory which will be Solr4's home:Code Block lang bash cd /usr/local/share # or cd ~
Get the solr4 tarball, untar it and install the application in a solr4/ directory within the share/ directory. This is just as shown above.
Code Block lang bash wget http://archive.apache.org/dist/lucene/solr/4.4.0/solr-4.4.0.tgz #or, if you don't have wget installed: curl -O http://archive.apache.org/dist/lucene/solr/4.4.0/solr-4.4.0.tgz # tar -xzvf solr-4.4.0.tgz # Copy the version number for future reference. echo solr-4.4.0 > solr-4.4.0/VERSION # Rename the folder 'solr4' for simplicity's sake mv solr-4.4.0 solr4 # Delete the tarball to keep our directory clean rm -r solr-4.4.0.tgz cd solr4
For now, we are using all the goodies that come with the vanilla Example datastore, so we simply rename the example directory provided and add the PAHMA-specific stuff (schema, etc.) on top of it.:
Code Block lang bash cp -r example/ pahma # Use your CollectionSpace tenant name here if you have one, rather than 'pahma' cd pahma # Again, use your tenant name instead of 'pahma' # Clean up some unnecessary directories rm -rf exampledocs/ rm -rf example-DIH/ rm -rf example-schemaless/ # NB: here we making a "single core" solr4 deployment... cd solr mv collection1/ pahma-metadata # your tenant name instead of 'pahma' cd pahma-metadata/ # your tenant name instead of 'pahma' # tell solr the name of our core (you could use vi... ;-) perl -i -pe 's/collection1/pahma-metadata/g' core.properties
Finally, get PAHMA-specific stuff (schema, etc.) from the GitHub repository and merge it into the Solr configuration:
Code Block lang bash cd /home/developers/ # assuming you want to put the local repository at the same level as solr4 git clone https://github.com/cspace-deployment/Tools.git # if you've been putting this where we said, this copy command will work. Otherwise, adjust accordingly. cp -r Tools/datasources/ucb/multicore/pahma/metadata/conf/* solr4/pahma/solr/pahma-metadata/conf/
Now we can start the solr instance we have just created, using the built-in jetty server:
Code Block lang bash cd /usr/local/share/solr4/pahma # use your tenant name # start single core solr instance (under jetty) in the background nohup java -Xmx512m -jar start.jar &
...