At the recently Drupal Camp Prague 09, I was introduced to ApacheSolr as a replacement to the standard Drupal search or the Google CSE.
On most sites the basic Google CSE setup is sufficient, however for some of the more serious "work" websites my colleague Nick and I got experimenting with the Drupal's implementation of ApacheSolr module.
Here is a quick and rough writeup on how it was implemented on work and my personal (janaksingh.com website).
Please feel free to share your experiences and tips.
Basic Installation
1) Install Java on CentOS if you havent already
2) Install ApacheSolr drupal module
cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal-contrib checkout -d apachesolr -r DRUPAL-6--2 contributions/modules/apachesolr/
3) Checkout the ApacheSolr PHP Lib inside the ApacheSolr module folder
svn checkout -r22 http://solr-php-client.googlecode.com/svn/trunk/ SolrPhpClient
4) Create a temp folder in your home directory
cd ~ mkdir temp cd temp
5) Download ApacheSolr in the temp folder
SVN Method
svn checkout http://svn.apache.org/repos/asf/lucene/solr/branches/branch-1.4 apache-solr
TAR Method
Grab the tarball from http://www.apache.org/dyn/closer.cgi/lucene/solr/
wget http://mirrors.ukfast.co.uk/sites/ftp.apache.org/lucene/solr/1.4.0/apache-solr-1.4.0.zip
tar -xzf apache-solr-1.4.0.zip mv apache-solr-1.4.0 apache-solr
I have moved my "apache-solr" folder to "/usr/local/share/" but I am not sure if this matters
6) Rename 2 default files in apache-solr/example/solr/conf/
sudo mv solrconfig.xml solrconfig.bak sudo mv schema.xml schema.bak
7) Copy the schema.xml and solrconfig.xml from the drupal apachesolr module folder into apache-solr/example/solr/conf/
Multisite / Multicore Setup
8) If you want multisite seach (multicore), here is what I did:
- duplicate the example folder to "sites"
- create a folder for each new website
- copy the conf folder from sites folder into each one of the website folders
- create a solr.xml file in the "sites" folder and defined a core for each of the sites.. here is what my sole.xml file looks like:
<solr persistent="false"> <!-- adminPath: RequestHandler path to manage cores. If 'null' (or absent), cores will not be manageable via request handler --> <cores adminPath="/admin/cores"> <core name="website1_core" instanceDir="website1.com" /> </cores> </solr>
9) Finally, in the Drupal ApacheSolr module, update the "Solr path" to the same core name you defined for the site in the sole.xml file. If you are using the example setup as outlined in the readme file that ships with the ApacheSolr Drupal module, you need not change anything as the default path the module ships with is correct. You only need to change this if you define your own cores.
Testing
If you are using the example site, test your installation as follows:
cd apache-solr/example sudo java -jar start.jar
If you are using the multicore setup from step 8, test as follows
cd apache-solr/sites sudo java -jar start.jar
Check the ApacheSolr admin page by visiting http://mydomain:8983/solr/admin/ or if you are using multicore http://mydomain:8983/solr/mycore_name/admin/
Auto start ApacheSolr on server reboot
You can follow the instructions on Want to start Apache solr automatically after a reboot? but depending on how you defined the cores above you will need to alter the path eg:
SOLR_DIR="/opt/apache-solr/example"
or
SOLR_DIR="/opt/apache-solr/sites"
Dont forget to change permissions on the sole bash file you created (etc/init.d/solr) and remember to install the script using chkconfig (all outlined in the guide above)
Security
By default, ApacheSolr does not ship with any kind of port protection, you are advised to secure your server ports by using iptables or a dedicated firewall (if you have one). For CentOS iptable guidelines click here
Further Reading
- Solr CoreAdmin
- Want to start Apache solr automatically after a reboot?
- Want to run Apache Solr with Tomcat and Drupal?
- Another very useful "Installing Apache Solr on Drupal 6" guide
- Drupal ApacheSolr readme
- Linux iptables to restrict port access










14 comments
11th Dec, 09
Nice! I've not had enough coffee this morning, to be sure, but did you skip the part where you start the server?
Also, in step 9, assuming you're using the packaged Jetty as per your instructions, the core to be used will be /solr, which is what the default values in the module are, so you won't need to modify anything.
Now, beware! There is no authentication at the Solr level, so you have to make sure that you don't open the 8983 (or 8080) port to the outside world. I use Uncomplicated Fire Wall http://ubuntuforums.org/showthread.php?t=823741 to close these ports to the outside world as a final step in my setup.
11th Dec, 09
"Solr Gods" grace this humble website ;) I am no expert at this, so your input is much valued :)
Good points above Rob, yes I did skip that part from the tutorial as I assumed the user would be wanting to run the site using the proper Core setup I mentioned in step 8.
The script at the auto restart link adds a link to the example folder which the user can modify for their needs. But i have rewritten the tutorial to make it a little more clearer.
If the user defined a core as outlined in the setup above, then yes they should update the path to "solr/mycore_name" they defined in the solr.xml file. if not, it will use the defaults.
I included a link to the iptables setup on CentOS. I think the readme file that ships with the module should mention the security warning too!
21st Jan, 10
Hi Janak,
Thanks for your great article. I followed along but somehow things went awry. When I run
sudo java -jar start.jarfrom within the example directory the app seems to hang. I get only this.
Error logs are blank aside from 404s which are returned whenever I try to hit http://mydomain:8983/solr/admin/.
I'm on a mediatemple dv 3.5 with centOS 5.2 (final)
Thanks,
Tim
22nd Jan, 10
Hi Tim,
It seems Jetty starts up fine for you! I had a similar issue where i could not connect to it using the admin interface! Have you checked the IPTables and SeLinux to make sure you have access to that port? I think by default (depending on setting) it will block the port! Be careful though as SeLinux can be a little tricky to configure.
Also make sure allow access to port 8983 from localhost only! Check my Further Reading section above for helpful links!
2nd Sep, 10
Hi Tim,
I'm sure you have already solved your problem. But for all of you who run into this headscratcher i found this:
Check if solr.war exists in your example/webapp folder. By default clean checkout of solr package comes without precompiled example "webapp"
To compile it yourself get ANT:
# apt-get install ant
or
# yum install ant
and in root of solr run:
# ant example
It will take a while to compile and when it's finished
# cd example
Now check if solor.war exists in webapps dir:
[root@xxxxxx example]# ls -l webapps/
total 4012
-rw-r--r-- 1 root root 4102706 Sep 2 15:35 solr.war
And try running solr again:
# sudo java -jar start.jar
Greetings,
Rafal
8th Oct, 10
Hi Janak,
Thank you for the detailed instructions. Following them I installed everything and can't get it working.
I have Java 1.6.0_20 (probably this is the cause?)
Running sudo java -jar start.jar gives failed SocketConnector error:
What kind of advise you could give to me? Thanks again!
12th Oct, 10
Hi yngens,
you need to install the ini.d script from http://drupal.org/node/545368. Once you have installed it, you can start apache solr by typing:
16th Oct, 10
Thanks again. I did install the script. Running and stopping it does not give any error:
root@host:/etc/init.d#
sudo /etc/init.d/solr stop
Stopping Solr
root@host:/etc/init.d#
sudo /etc/init.d/solr start
Starting Solr
However, it is still unavailable on http://mysite.com:8983/solr/admin/ and the status page still shows:
Your site was unable to contact the Apache Solr server.
If I run 'sudo java -jar start.jar' on /usr/local/share/apache-solr/example I get:
2010-10-16 02:58:11.300::WARN: failed SocketConnector @ 0.0.0.0:8983
java.net.BindException: Address already in use
I use APF and have opened port#8983, but did not touch any socket configurations since have no idea where I should configure them. I am worried about this error message, but can't figure out where I should look to solve it.
22nd Oct, 10
I've got through socket/port issues. But now have another one: NFO: JNDI not configured for solr (NoInitialContextEx)
java -jar start.jar 2010-10-21 16:40:25.980::INFO: Logging to STDERR via org.mortbay.log.StdErrLog 2010-10-21 16:40:26.120::INFO: jetty-6.1.3 2010-10-21 16:40:26.201::INFO: Extract jar:file:/usr/apache-solr-1.4.0/example/webapps/solr.war!/ to /usr/apache-solr-1.4.0/example/work/Jetty_0_0_0_0_8983_solr.war__solr__k1kf17/webapp Oct 21, 2010 4:40:26 PM org.apache.solr.core.SolrResourceLoader locateSolrHome INFO: JNDI not configured for solr (NoInitialContextEx) Oct 21, 2010 4:40:26 PM org.apache.solr.core.SolrResourceLoader locateSolrHome INFO: solr home defaulted to 'solr/' (could not find system property or JNDI) Oct 21, 2010 4:40:26 PM org.apache.solr.core.SolrResourceLoader <init> INFO: Solr home set to 'solr/' Oct 21, 2010 4:40:26 PM org.apache.solr.servlet.SolrDispatchFilter init INFO: SolrDispatchFilter.init() Oct 21, 2010 4:40:26 PM org.apache.solr.core.SolrResourceLoader locateSolrHome INFO: JNDI not configured for solr (NoInitialContextEx) Oct 21, 2010 4:40:26 PM org.apache.solr.core.SolrResourceLoader locateSolrHome INFO: solr home defaulted to 'solr/' (could not find system property or JNDI) Oct 21, 2010 4:40:26 PM org.apache.solr.core.CoreContainer$Initializer initialize INFO: looking for solr.xml: /usr/apache-solr-1.4.0/example/solr/solr.xml Oct 21, 2010 4:40:26 PM org.apache.solr.core.SolrResourceLoader <init> INFO: Solr home set to 'solr/' Oct 21, 2010 4:40:27 PM org.apache.solr.core.SolrConfig <init> INFO: Loaded SolrConfig: solrconfig.xml Oct 21, 2010 4:40:27 PM org.apache.solr.core.SolrCore <init> INFO: Opening new SolrCore at solr/, dataDir=solr/./data/ Oct 21, 2010 4:40:27 PM org.apache.solr.schema.IndexSchema readSchema INFO: Reading Solr Schema Oct 21, 2010 4:40:27 PM org.apache.solr.schema.IndexSchema readSchema INFO: Schema name=drupal-1.9.6 Oct 21, 2010 4:40:27 PM org.apache.solr.util.plugin.AbstractPluginLoader load INFO: created string: org.apache.solr.schema.StrField Oct 21, 2010 4:40:27 PM org.apache.solr.util.plugin.AbstractPluginLoader load INFO: created boolean: org.apache.solr.schema.BoolField Oct 21, 2010 4:40:27 PM org.apache.solr.util.plugin.AbstractPluginLoader load INFO: created integer: org.apache.solr.schema.IntField Oct 21, 2010 4:40:27 PM org.apache.solr.util.plugin.AbstractPluginLoader load INFO: created long: org.apache.solr.schema.LongField Oct 21, 2010 4:40:27 PM org.apache.solr.util.plugin.AbstractPluginLoader load INFO: created float: org.apache.solr.schema.FloatField Oct 21, 2010 4:40:27 PM org.apache.solr.util.plugin.AbstractPluginLoader load INFO: created double: org.apache.solr.schema.DoubleField Oct 21, 2010 4:40:27 PM org.apache.solr.util.plugin.AbstractPluginLoader load INFO: created sint: org.apache.solr.schema.SortableIntField Oct 21, 2010 4:40:27 PM org.apache.solr.util.plugin.AbstractPluginLoader load INFO: created slong: org.apache.solr.schema.SortableLongField Oct 21, 2010 4:40:27 PM org.apache.solr.util.plugin.AbstractPluginLoader load INFO: created sfloat: org.apache.solr.schema.SortableFloatField Oct 21, 2010 4:40:27 PM org.apache.solr.util.plugin.AbstractPluginLoader load INFO: created sdouble: org.apache.solr.schema.SortableDoubleField Oct 21, 2010 4:40:27 PM org.apache.solr.util.plugin.AbstractPluginLoader load INFO: created tint: org.apache.solr.schema.TrieIntField Oct 21, 2010 4:40:27 PM org.apache.solr.util.plugin.AbstractPluginLoader load INFO: created tfloat: org.apache.solr.schema.TrieFloatField Oct 21, 2010 4:40:27 PM org.apache.solr.util.plugin.AbstractPluginLoader load INFO: created tlong: org.apache.solr.schema.TrieLongField Oct 21, 2010 4:40:27 PM org.apache.solr.util.plugin.AbstractPluginLoader load INFO: created tdouble: org.apache.solr.schema.TrieDoubleField Oct 21, 2010 4:40:27 PM org.apache.solr.util.plugin.AbstractPluginLoader load INFO: created date: org.apache.solr.schema.DateField Oct 21, 2010 4:40:27 PM org.apache.solr.util.plugin.AbstractPluginLoader load INFO: created tdate: org.apache.solr.schema.TrieDateField Oct 21, 2010 4:40:27 PM org.apache.solr.util.plugin.AbstractPluginLoader load INFO: created null: org.apache.solr.analysis.WhitespaceTokenizerFactory Oct 21, 2010 4:40:27 PM org.apache.solr.util.plugin.AbstractPluginLoader load INFO: created text_ws: org.apache.solr.schema.TextField Oct 21, 2010 4:40:27 PM org.apache.solr.util.plugin.AbstractPluginLoader load INFO: created null: org.apache.solr.analysis.MappingCharFilterFactory Oct 21, 2010 4:40:27 PM org.apache.solr.util.plugin.AbstractPluginLoader load INFO: created null: org.apache.solr.analysis.WhitespaceTokenizerFactory Oct 21, 2010 4:40:27 PM org.apache.solr.util.plugin.AbstractPluginLoader load INFO: created null: org.apache.solr.analysis.SynonymFilterFactory Oct 21, 2010 4:40:27 PM org.apache.solr.util.plugin.AbstractPluginLoader load INFO: created null: org.apache.solr.analysis.StopFilterFactory Oct 21, 2010 4:40:27 PM org.apache.solr.util.plugin.AbstractPluginLoader load INFO: created null: org.apache.solr.analysis.WordDelimiterFilterFactory Oct 21, 2010 4:40:27 PM org.apache.solr.util.plugin.AbstractPluginLoader load INFO: created null: org.apache.solr.analysis.LowerCaseFilterFactory Oct 21, 2010 4:40:27 PM org.apache.solr.util.plugin.AbstractPluginLoader load INFO: created null: org.apache.solr.analysis.SnowballPorterFilterFactory Oct 21, 2010 4:40:27 PM org.apache.solr.util.plugin.AbstractPluginLoader load INFO: created null: org.apache.solr.analysis.RemoveDuplicatesTokenFilterFactory Oct 21, 2010 4:40:27 PM org.apache.solr.util.plugin.AbstractPluginLoader load INFO: created null: org.apache.solr.analysis.MappingCharFilterFactory Oct 21, 2010 4:40:27 PM org.apache.solr.util.plugin.AbstractPluginLoader load INFO: created null: org.apache.solr.analysis.WhitespaceTokenizerFactory Oct 21, 2010 4:40:27 PM org.apache.solr.util.plugin.AbstractPluginLoader load INFO: created null: org.apache.solr.analysis.StopFilterFactory Oct 21, 2010 4:40:27 PM org.apache.solr.util.plugin.AbstractPluginLoader load INFO: created null: org.apache.solr.analysis.WordDelimiterFilterFactory Oct 21, 2010 4:40:27 PM org.apache.solr.util.plugin.AbstractPluginLoader load INFO: created null: org.apache.solr.analysis.LowerCaseFilterFactory Oct 21, 2010 4:40:27 PM org.apache.solr.util.plugin.AbstractPluginLoader load INFO: created null: org.apache.solr.analysis.SnowballPorterFilterFactory Oct 21, 2010 4:40:27 PM org.apache.solr.util.plugin.AbstractPluginLoader load INFO: created null: org.apache.solr.analysis.RemoveDuplicatesTokenFilterFactory Oct 21, 2010 4:40:27 PM org.apache.solr.util.plugin.AbstractPluginLoader load INFO: created text: org.apache.solr.schema.TextField Oct 21, 2010 4:40:27 PM org.apache.solr.util.plugin.AbstractPluginLoader load INFO: created null: org.apache.solr.analysis.KeywordTokenizerFactory Oct 21, 2010 4:40:27 PM org.apache.solr.util.plugin.AbstractPluginLoader load INFO: created null: org.apache.solr.analysis.LowerCaseFilterFactory Oct 21, 2010 4:40:27 PM org.apache.solr.util.plugin.AbstractPluginLoader load INFO: created null: org.apache.solr.analysis.KeywordTokenizerFactory Oct 21, 2010 4:40:27 PM org.apache.solr.util.plugin.AbstractPluginLoader load INFO: created null: org.apache.solr.analysis.LowerCaseFilterFactory Oct 21, 2010 4:40:27 PM org.apache.solr.util.plugin.AbstractPluginLoader load INFO: created null: org.apache.solr.analysis.EdgeNGramFilterFactory Oct 21, 2010 4:40:27 PM org.apache.solr.util.plugin.AbstractPluginLoader load INFO: created edge_n2_kw_text: org.apache.solr.schema.TextField Oct 21, 2010 4:40:27 PM org.apache.solr.util.plugin.AbstractPluginLoader load INFO: created null: org.apache.solr.analysis.StandardTokenizerFactory Oct 21, 2010 4:40:27 PM org.apache.solr.util.plugin.AbstractPluginLoader load INFO: created null: org.apache.solr.analysis.StopFilterFactory Oct 21, 2010 4:40:27 PM org.apache.solr.util.plugin.AbstractPluginLoader load INFO: created null: org.apache.solr.analysis.LengthFilterFactory Oct 21, 2010 4:40:27 PM org.apache.solr.util.plugin.AbstractPluginLoader load INFO: created null: org.apache.solr.analysis.LowerCaseFilterFactory Oct 21, 2010 4:40:27 PM org.apache.solr.util.plugin.AbstractPluginLoader load INFO: created null: org.apache.solr.analysis.RemoveDuplicatesTokenFilterFactory Oct 21, 2010 4:40:27 PM org.apache.solr.util.plugin.AbstractPluginLoader load INFO: created textSpell: org.apache.solr.schema.TextField Oct 21, 2010 4:40:27 PM org.apache.solr.util.plugin.AbstractPluginLoader load INFO: created null: org.apache.solr.analysis.KeywordTokenizerFactory Oct 21, 2010 4:40:27 PM org.apache.solr.util.plugin.AbstractPluginLoader load INFO: created null: org.apache.solr.analysis.LowerCaseFilterFactory Oct 21, 2010 4:40:27 PM org.apache.solr.util.plugin.AbstractPluginLoader load INFO: created null: org.apache.solr.analysis.TrimFilterFactory Oct 21, 2010 4:40:27 PM org.apache.solr.util.plugin.AbstractPluginLoader load INFO: created sortString: org.apache.solr.schema.TextField Oct 21, 2010 4:40:27 PM org.apache.solr.util.plugin.AbstractPluginLoader load INFO: created rand: org.apache.solr.schema.RandomSortField Oct 21, 2010 4:40:27 PM org.apache.solr.util.plugin.AbstractPluginLoader load INFO: created ignored: org.apache.solr.schema.StrField Oct 21, 2010 4:40:27 PM org.apache.solr.schema.IndexSchema readSchema INFO: default search field is body Oct 21, 2010 4:40:27 PM org.apache.solr.schema.IndexSchema readSchema INFO: query parser default operator is AND Oct 21, 2010 4:40:27 PM org.apache.solr.schema.IndexSchema readSchema INFO: unique key field: id Oct 21, 2010 4:40:27 PM org.apache.solr.core.JmxMonitoredMap <init> INFO: No JMX servers found, not exposing Solr information with JMX. Oct 21, 2010 4:40:27 PM org.apache.solr.core.SolrCore initListeners INFO: Added SolrEventListener: org.apache.solr.core.QuerySenderListener{queries=[{q=solr,start=0,rows=10}, {q=rocks,start=0,rows=10}, {q=static newSearcher warming query from solrconfig.xml}]} Oct 21, 2010 4:40:27 PM org.apache.solr.core.SolrCore initListeners INFO: Added SolrEventListener: org.apache.solr.core.QuerySenderListener{queries=[{q=fast_warm,start=0,rows=10}, {q=static firstSearcher warming query from solrconfig.xml}]} Oct 21, 2010 4:40:27 PM org.apache.solr.core.SolrCore initIndex WARNING: Solr index directory 'solr/./data/index' doesn't exist. Creating new index... Oct 21, 2010 4:40:27 PM org.apache.solr.core.SolrDeletionPolicy onInit INFO: SolrDeletionPolicy.onInit: commits:num=1 commit{dir=/usr/apache-solr-1.4.0/example/solr/data/index,segFN=segments_1,version=1287704427446,generation=1,filenames=[segments_1] Oct 21, 2010 4:40:27 PM org.apache.solr.core.SolrDeletionPolicy updateCommits INFO: newest commit = 1287704427446 Oct 21, 2010 4:40:27 PM org.apache.solr.request.XSLTResponseWriter init INFO: xsltCacheLifetimeSeconds=5 Oct 21, 2010 4:40:27 PM org.apache.solr.core.RequestHandlers initHandlersFromConfig INFO: created standard: solr.SearchHandler Oct 21, 2010 4:40:27 PM org.apache.solr.core.RequestHandlers initHandlersFromConfig INFO: created dismax: solr.SearchHandler Oct 21, 2010 4:40:27 PM org.apache.solr.core.RequestHandlers initHandlersFromConfig INFO: created partitioned: solr.SearchHandler Oct 21, 2010 4:40:27 PM org.apache.solr.core.RequestHandlers initHandlersFromConfig INFO: created mlt: solr.MoreLikeThisHandler Oct 21, 2010 4:40:27 PM org.apache.solr.core.RequestHandlers initHandlersFromConfig INFO: adding lazy requestHandler: solr.SearchHandler Oct 21, 2010 4:40:27 PM org.apache.solr.core.RequestHandlers initHandlersFromConfig INFO: created /elevate: solr.SearchHandler Oct 21, 2010 4:40:27 PM org.apache.solr.core.RequestHandlers initHandlersFromConfig INFO: created /update: solr.XmlUpdateRequestHandler Oct 21, 2010 4:40:27 PM org.apache.solr.core.RequestHandlers initHandlersFromConfig INFO: created /analysis: solr.AnalysisRequestHandler Oct 21, 2010 4:40:27 PM org.apache.solr.core.RequestHandlers initHandlersFromConfig INFO: adding lazy requestHandler: solr.CSVRequestHandler Oct 21, 2010 4:40:27 PM org.apache.solr.core.RequestHandlers initHandlersFromConfig INFO: created /update/csv: solr.CSVRequestHandler Oct 21, 2010 4:40:27 PM org.apache.solr.core.RequestHandlers initHandlersFromConfig INFO: created /admin/: org.apache.solr.handler.admin.AdminHandlers Oct 21, 2010 4:40:27 PM org.apache.solr.core.RequestHandlers initHandlersFromConfig INFO: created /admin/ping: PingRequestHandler Oct 21, 2010 4:40:27 PM org.apache.solr.core.RequestHandlers initHandlersFromConfig INFO: created /debug/dump: solr.DumpRequestHandler Oct 21, 2010 4:40:27 PM org.apache.solr.core.SolrCore initDeprecatedSupport WARNING: solrconfig.xml uses deprecated <admin/gettableFiles>, Please update your config to use the ShowFileRequestHandler. Oct 21, 2010 4:40:27 PM org.apache.solr.core.SolrCore initDeprecatedSupport WARNING: adding ShowFileRequestHandler with hidden files: [ADMIN-EXTRA.HTML, SCRIPTS.CONF, SPELLINGS.TXT, XSLT] Oct 21, 2010 4:40:27 PM org.apache.solr.search.SolrIndexSearcher <init> INFO: Opening Searcher@137d4a4 main Oct 21, 2010 4:40:27 PM org.apache.solr.update.DirectUpdateHandler2$CommitTracker <init> INFO: AutoCommit: if uncommited for 120000ms; if 2000 uncommited docs Oct 21, 2010 4:40:27 PM org.apache.solr.handler.component.SpellCheckComponent inform INFO: Initializing spell checkers Oct 21, 2010 4:40:27 PM org.apache.solr.handler.component.SpellCheckComponent inform INFO: Registering newSearcher listener for spellchecker: default Oct 21, 2010 4:40:27 PM org.apache.solr.handler.component.SpellCheckComponent inform INFO: Registering newSearcher listener for spellchecker: jarowinkler Oct 21, 2010 4:40:27 PM org.apache.solr.handler.component.SpellCheckComponent inform WARNING: No queryConverter defined, using default converter Oct 21, 2010 4:40:27 PM org.apache.solr.servlet.SolrDispatchFilter init SEVERE: Could not start SOLR. Check solr/home property org.apache.solr.common.SolrException: Error initializing QueryElevationComponent. at org.apache.solr.handler.component.QueryElevationComponent.inform(QueryElevationComponent.java:197) at org.apache.solr.core.SolrResourceLoader.inform(SolrResourceLoader.java:486) at org.apache.solr.core.SolrCore.<init>(SolrCore.java:588) at org.apache.solr.core.CoreContainer$Initializer.initialize(CoreContainer.java:137) at org.apache.solr.servlet.SolrDispatchFilter.init(SolrDispatchFilter.java:83) at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:99) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:594) at org.mortbay.jetty.servlet.Context.startContext(Context.java:139) at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1218) at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:500) at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:147) at org.mortbay.jetty.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:161) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:147) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:117) at org.mortbay.jetty.Server.doStart(Server.java:210) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) at org.mortbay.xml.XmlConfiguration.main(XmlConfiguration.java:929) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.mortbay.start.Main.invokeMain(Main.java:183) at org.mortbay.start.Main.start(Main.java:497) at org.mortbay.start.Main.main(Main.java:115) Caused by: org.apache.solr.common.SolrException: QueryElevationComponent missing config file: 'elevate.xml either: /usr/apache-solr-1.4.0/example/solr/conf/elevate.xml or /usr/apache-solr-1.4.0/example/solr/./data/elevate.xml must exist, but not both. at org.apache.solr.handler.component.QueryElevationComponent.inform(QueryElevationComponent.java:174) ... 28 more Oct 21, 2010 4:40:27 PM org.apache.solr.core.QuerySenderListener newSearcher INFO: QuerySenderListener sending requests to Searcher@137d4a4 main Oct 21, 2010 4:40:27 PM org.apache.solr.servlet.SolrDispatchFilter init INFO: SolrDispatchFilter.init() done Oct 21, 2010 4:40:27 PM org.apache.solr.common.SolrException log SEVERE: java.lang.NullPointerException at org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:173) at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:131) at org.apache.solr.core.SolrCore.execute(SolrCore.java:1316) at org.apache.solr.core.QuerySenderListener.newSearcher(QuerySenderListener.java:52) at org.apache.solr.core.SolrCore$3.call(SolrCore.java:1146) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Oct 21, 2010 4:40:27 PM org.apache.solr.core.SolrCore execute INFO: webapp=null path=null params={start=0&event=firstSearcher&q=fast_warm&rows=10} status=500 QTime=7 Oct 21, 2010 4:40:27 PM org.apache.solr.common.SolrException log SEVERE: java.lang.NullPointerException at org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:173) at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:131) at org.apache.solr.core.SolrCore.execute(SolrCore.java:1316) at org.apache.solr.core.QuerySenderListener.newSearcher(QuerySenderListener.java:52) at org.apache.solr.core.SolrCore$3.call(SolrCore.java:1146) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Oct 21, 2010 4:40:27 PM org.apache.solr.core.SolrCore execute INFO: webapp=null path=null params={event=firstSearcher&q=static+firstSearcher+warming+query+from+solrconfig.xml} status=500 QTime=0 Oct 21, 2010 4:40:27 PM org.apache.solr.core.QuerySenderListener newSearcher INFO: QuerySenderListener done. Oct 21, 2010 4:40:27 PM org.apache.solr.handler.component.SpellCheckComponent$SpellCheckerListener newSearcher INFO: Loading spell index for spellchecker: default Oct 21, 2010 4:40:27 PM org.apache.solr.handler.component.SpellCheckComponent$SpellCheckerListener newSearcher INFO: Loading spell index for spellchecker: jarowinkler Oct 21, 2010 4:40:27 PM org.apache.solr.core.SolrCore registerSearcher INFO: Registered new searcher Searcher@137d4a4 main Oct 21, 2010 4:40:27 PM org.apache.solr.servlet.SolrServlet init INFO: SolrServlet.init() Oct 21, 2010 4:40:27 PM org.apache.solr.core.SolrResourceLoader locateSolrHome INFO: JNDI not configured for solr (NoInitialContextEx) Oct 21, 2010 4:40:27 PM org.apache.solr.core.SolrResourceLoader locateSolrHome INFO: solr home defaulted to 'solr/' (could not find system property or JNDI) Oct 21, 2010 4:40:27 PM org.apache.solr.servlet.SolrServlet init INFO: SolrServlet.init() done Oct 21, 2010 4:40:27 PM org.apache.solr.core.SolrResourceLoader locateSolrHome INFO: JNDI not configured for solr (NoInitialContextEx) Oct 21, 2010 4:40:27 PM org.apache.solr.core.SolrResourceLoader locateSolrHome INFO: solr home defaulted to 'solr/' (could not find system property or JNDI) Oct 21, 2010 4:40:27 PM org.apache.solr.servlet.SolrUpdateServlet init INFO: SolrUpdateServlet.init() done 2010-10-21 16:40:27.839::WARN: failed SocketConnector @ 0.0.0.0:8983 java.net.BindException: Address already in use at java.net.PlainSocketImpl.socketBind(Native Method) at java.net.PlainSocketImpl.bind(Unknown Source) at java.net.ServerSocket.bind(Unknown Source) at java.net.ServerSocket.<init>(Unknown Source) at java.net.ServerSocket.<init>(Unknown Source) at org.mortbay.jetty.bio.SocketConnector.newServerSocket(SocketConnector.java:78) at org.mortbay.jetty.bio.SocketConnector.open(SocketConnector.java:72) at org.mortbay.jetty.AbstractConnector.doStart(AbstractConnector.java:252) at org.mortbay.jetty.bio.SocketConnector.doStart(SocketConnector.java:145) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) at org.mortbay.jetty.Server.doStart(Server.java:221) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) at org.mortbay.xml.XmlConfiguration.main(XmlConfiguration.java:929) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.mortbay.start.Main.invokeMain(Main.java:183) at org.mortbay.start.Main.start(Main.java:497) at org.mortbay.start.Main.main(Main.java:115) 2010-10-21 16:40:27.841::WARN: failed Server@c72243 java.net.BindException: Address already in use at java.net.PlainSocketImpl.socketBind(Native Method) at java.net.PlainSocketImpl.bind(Unknown Source) at java.net.ServerSocket.bind(Unknown Source) at java.net.ServerSocket.<init>(Unknown Source) at java.net.ServerSocket.<init>(Unknown Source) at org.mortbay.jetty.bio.SocketConnector.newServerSocket(SocketConnector.java:78) at org.mortbay.jetty.bio.SocketConnector.open(SocketConnector.java:72) at org.mortbay.jetty.AbstractConnector.doStart(AbstractConnector.java:252) at org.mortbay.jetty.bio.SocketConnector.doStart(SocketConnector.java:145) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) at org.mortbay.jetty.Server.doStart(Server.java:221) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) at org.mortbay.xml.XmlConfiguration.main(XmlConfiguration.java:929) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.mortbay.start.Main.invokeMain(Main.java:183) at org.mortbay.start.Main.start(Main.java:497) at org.mortbay.start.Main.main(Main.java:115) 2010-10-21 16:40:27.842::WARN: EXCEPTION java.net.BindException: Address already in use at java.net.PlainSocketImpl.socketBind(Native Method) at java.net.PlainSocketImpl.bind(Unknown Source) at java.net.ServerSocket.bind(Unknown Source) at java.net.ServerSocket.<init>(Unknown Source) at java.net.ServerSocket.<init>(Unknown Source) at org.mortbay.jetty.bio.SocketConnector.newServerSocket(SocketConnector.java:78) at org.mortbay.jetty.bio.SocketConnector.open(SocketConnector.java:72) at org.mortbay.jetty.AbstractConnector.doStart(AbstractConnector.java:252) at org.mortbay.jetty.bio.SocketConnector.doStart(SocketConnector.java:145) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) at org.mortbay.jetty.Server.doStart(Server.java:221) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) at org.mortbay.xml.XmlConfiguration.main(XmlConfiguration.java:929) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.mortbay.start.Main.invokeMain(Main.java:183) at org.mortbay.start.Main.start(Main.java:497) at org.mortbay.start.Main.main(Main.java:115)22nd Oct, 10
In step #8 for Multisite / Multicore Setup which "sites" folder we are talking about? The one, wich is in Drupal installation? For example, I have Drupal in '/usr/drupal/drupal6' and Apache Solr in '/usr/apache-solr'. Should I, in my case,
cp -R /usr/apache-solr/example /usr/drupal/drupal6/sites
and proceed with the rest of instructions?
22nd Oct, 10
I think I figured out I just need to copy 'example' folder in the same place as 'sites'. But then should I create a folder for each new website in 'sites' folder as 'sites/mysite1.com/', 'sites/mysite2.com/', 'sites/mysite3.com/', etc?
And copy '/usr/apache-solr/sites/solr/conf' (it is not in 'sites' folder, but 'sites'solr' forder) into each of newly created websites' folders?
Should I create a solr.xml file in the "sites" folder (not in of each websites folder?) and define a core for each of the sites in a single solr.xml file?
Sorry for being so pedantic, but I am that good in working in SSH, so would like to comply with your instructions as exact as possible. I've been fighting to make Apache Solr to work in my CENTOS 5.5 for already several days with no success. Still have that 'INFO: JNDI not configured for solr (NoInitialContextEx)
' error, but decided to try multisite setup first. Maybe it will work through?
30th Nov, 10
Step 9 is not very clear, where is exactly sole.xml ?
20th Apr, 11
to copy 'example' folder in the same place as 'sites'. But then should I create a folder for each new website in 'sites' folder
21st Jul, 11
Extremely inspiring article, Many thanks !!
Post new comment