Skip to content

Instantly share code, notes, and snippets.

@cwilper
Last active May 20, 2019 17:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cwilper/50c33ab861e47936f45a8909a0ee7a8b to your computer and use it in GitHub Desktop.
Save cwilper/50c33ab861e47936f45a8909a0ee7a8b to your computer and use it in GitHub Desktop.
Setting up Solr for DSpace 7 Preview 1

Setting up Solr for DSpace 7 Preview 1

These steps worked for me (cwilper) as of 2019/05/20. You don't need to deploy Solr this way...I'm just documenting what worked for me today.

Define a BASE dir

This is the parent directory of your dspace and solr installs. For example, if you will be deploying your dspace install under $HOME/Work/dspace/community-7/dspace, then BASEDIR should be set as follows:

BASEDIR=$HOME/Work/dspace/community-7

Install solr and set up symlinks

Note: Here we use Solr 7.3.1 because that is the exact version of the client libraries currently used by DSpace. A newer 7.x might work, but I wouldn't advise using Solr 8+ -- the automatic core upgrade version check in the ant deploy script is not compatible with it.

cd $BASEDIR
wget http://archive.apache.org/dist/lucene/solr/7.3.1/solr-7.3.1.tgz
tar -xvf solr-7.3.1.tgz
ln -s solr-7.3.1 solr
ln -s ../../../dspace/solr solr/server/solr/dspace

Build and deploy dspace

Build and deploy from this branch, which has a couple necessary fixes that aren't in master yet:

https://github.com/atmire/DSpace/tree/DS-3695-solr-fixes

Make sure the solr url is correct in your deployed local.cfg

Upgrade database

If you're upgrading from a DSpace 6 database, run $BASEDIR/dspace/bin/dspace database migrate ignored now.

Start solr

$BASEDIR/solr/bin/solr start -p $SOLR_PORT

...with SOLR_PORT matching what's in your local.cfg

Start dspace and index discovery

Use your normal way of starting DSpace. Then run:

$BASEDIR/dspace/bin/dspace index-discovery -b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment