Using multi-core features
As mentioned before, you are able to set up a single Solr instance, the backend engine of eZ Find, to serve multiple sites (it does not even matter if these are on the same box). Similar to a database, Solr is capable of having multiple search indexes from one servlet, because Solr supports the concepts of multiple "cores". This means that it can run multiple instances of itself inside a servlet container. Each core has its own set of configuration files (including the "schema") and dedicated directories.
Lets go through the steps of setting up a Solr instance which must serve two sites. To keep it simple we'll call them ezlabs .no and ez.no.
The easiest way is to first prepare a central location for the Solr Index. This can for example be:
/srv/solr
- Next you should create two additional directories inside it, as follows:
/srv/solr/java /srv/solr/cores
- Inside /srv/solr/java you should store a copy of the contents of the java directory of your eZ Find installation, or if you don't have one yet, download it from http://ez.no/ezfind.
- Next create a symlink for the solr/lib plugin directory inside /srv/solr/cores like this:
ln -s /srv/solr/java/solr/lib /srv/solr/cores
-
Create additional directories for each of your sites, called ezlabs and ez in your /srv/solr/cores. Both of them must contain a data and a conf subdirectory.
Your file structure should look something like this:/srv/solr/cores ezlabsno/data ezlabsno/conf ezno/data ezno/conf - In both conf directories you must then copy the contents of the folder extension/ezfind/java/solr/conf/* and adapt the Solr dataDir.
- Next create a solr.xml file inside /srv/solr/cores/solr.xml with the following content:
<?xml version="1.0" encoding="UTF-8" ?> <!-- snip the comments from Apache wiki --> <solr persistent="true" sharedLib="lib"> <cores adminPath="/admin/cores"> <core name="ezlabsno" instanceDir="ezlabsno" /> <core name="ezno" instanceDir="ezno" /> </cores> </solr> - If you already have indexed data for one or both of your sites, you may stop Solr from indexing them again. You should then copy the index and spellchecker directories to your data directories (in /srv/solr/cores/ezlabsno/data and /srv/solr/cores/ezno/data).
- Now you should restart Solr with the following parameters:
cd /srv/solr/java; java -Dsolr.solr.home=/srv/solr/cores -jar start.jar
- It's important to keep an eye on the output, in case of potential errors (for example things that are permission related).
- And finally you can configure the individual Exponential and eZ Find instances with the dedicated URLs as base URLs in solr.ini:
http://localhost:8983/solr/ezlabsno http://localhost:8983/solr/ezno
Contributors
- Ester Heylen Updated
- Francesco Commenter
- chs Commenter
- Michael Maclean Commenter
- Jason Calhoun Commenter
Comments (6 historical)
Written by readers of the earlier documentation sites, kept as they were.
something missing?
Francesco ·
I guess something is missing after "Now you should restart Solr with the following parameters as follows:"
isn't it?
yes... not working
Francesco ·
The above advices are not complete, as I said before.
(I've spent 3hr already on this.... geee!)
there is sure another mistake
should be
without the blank space at the end, isn't it?
(see http://wiki.apache.org/solr/CoreAdmin )
still not working
Francesco ·
Thank you for the updates.
It still does not work for us (while it works with single solr).
We get this error (with our server is Debian lenny)
while trying to surf in http://localhost... we get "severe SOLR configuration error"
:(
We do really need to have solr working for several ez websites
Thank you for your help,
Fra
Re: still not working
chs ·
I can't say if this is the same problem but I just got the same error (GRAVE: org.apache.solr.common.SolrException: Error loading class 'org.ezsystems.solr.handler.ezfind.eZFindRequestHandler).
The directory extension/ezfind/java/solr/lib/ was missing and, with it, the file ezsystems-ezfind-solr-extension-2.1.jar.
I kinda messed up using SVN to transfer eZFind from one box to another.
mes deux centimes de franc ...
Typo in solr.xml
Michael Maclean ·
It seems that the line which says:
<solr persistent="true" shareLib="lib">
has a typo. I've had much more success using
<solr persistent="true" sharedLib="lib">
(shared, not share)
My Multi-Core Woes [RESOLVED]
Jason Calhoun ·
I was able to get mult-core installed with the instructions above. But the search did not work for my sites. My check list looked like this.
Solr running: OK,
Solr Administration Pages working: OK,
Index with updatesearchindexsolr.php: OK,?
Synchronize from site_admin: FAILED,
Search results from site: FAILED,
[SOLUTION]
Make a change to each sites extension/ezfind/settings/solr.ini . add /<corename> to the end of each SearchServerURI like below:
[SolrBase]
# Base URI of the Solr server
SearchServerURI=http://localhost:8983/solr/site1
You must then re-index each site with php extension/ezfind/bin/php/updatesearchindexsolr.php -s site_admin