This guide is based on SolrPlugin 1.10 (16. Dec. 2010)
/solrInto there copy the contents of a "normal" solr-home to be found in <foswiki>/solr and create a subdirectory called "multicore". Your result should look like this:
Contents of /solr: 60solr.policy etc .htaccess lib logs multicore solr solr-context.xml start.jar webappsIn your new multicore-directory create a file called "solr.xml" and copy the following contents into it:
<?xml version="1.0" encoding="UTF-8" ?> <solr persistent="false"> <cores adminPath="/admin/cores"> <!-- ...Cores will be placed here... --> </cores> </solr>Each core will be added to this file later on.
You need to install SolrPlugin in each wiki with configure or manually.
The following will assume your Solr-home is in /solr and your wiki will be called "example".
Every following step must be applied to each Foswiki individually.
Contents of /solr/multicore/solr.xml: <?xml version="1.0" encoding="UTF-8" ?> <solr persistent="false"> <cores adminPath="/admin/cores"> <!-- already existing other cores... --> <core name="aCore" instanceDir="aCore" /> <core name="anotherCore" instanceDir="anotherCore" /> <!-- our newly added core: ---> <core name="example" instanceDir="example" /> </cores> </solr>Each core has its own directory called instanceDir associated with it. You need to create this directory inside your multicore path:
# create new instance directory: mkdir /solr/multicore/exampleIn order to keep thing easy you should name this directory after your wiki.
# copy <foswiki>/solr/solr/* to /solr/multicore/example cp -R /srv/www/htdocs/foswiki/solr/solr/* /solr/multicore/example Contents of /solr/multicor/example: conf data libNow one of the just copied files needs to be adapted to it's new environment. Edit the file "solrconfig.xml" inside "conf" and correct the "dataDir" to reflect the new location:
In /solr/multicore/beispiel/conf/solrconfig.xml change line 71: <dataDir>${solr.data.dir:./solr/data}</dataDir> to <dataDir>${solr.data.dir:./multicore/example/data}</dataDir>
Line 16 of <foswiki>/lib/Webservices/Solr.pm: default => sub { URI->new( 'http://localhost:8983/solr' ) } becomes: default => sub { URI->new( 'http://localhost:8983/solr/example' ) }
Change line 10 of <foswiki>/tools/solrstart test -z $SOLRHOME && SOLRHOME=$FOSWIKI_ROOT/solr to test -z $SOLRHOME && SOLRHOME=/solr and Line 22 nohup java -jar start.jar >/dev/null & to nohup java -Dsolr.solr.home=multicore -jar start.jar >/dev/null &(Don't forget to change the !# line and FOSWIKI_ROOT as you would in a normal installation.)
{SolrPlugin}{SolrHome} = /solr(Note: not /solr/multicore or /solr/multicore/example I might be wrong here tough)
{SolrPlugin}{Url} = http://localhost:8983/solr must be changed to {SolrPlugin}{Url} = http://localhost:8983/solr/exampleAlso change your SolrStartCmd to use multicore as home-directory for solr (see solrstart).
Category | Using Extensions |
Related Topics |