System Details:
OS: Cent OS 5.5 x86_64
java - 1.7 (1.7.0_25)
tomcat : 6.0.37
solr 4.4 (configured for multi-core)
I had solr 4.4 multicore running perfectly on jetty (although running just one core at the moment).
I need to run the same on tomcat 6 to see if there it can perform better than jetty.
Here is what I did:
1. downloaded tomcat 6
from : http://mirrors.sonic.net/apache/tomcat/tomcat-6/v6.0.37/bin/apache-tomcat-6.0.37.tar.gz
2. extracted apache-tomcat-6.0.37.tar.gz to /usr/local/tomcat/
created start up and shutdown scripts and the process runs through user:group tomcat:tomcat
check the start up scripts and found tomcat to run fine. I modified the port from 8080 to 8400
3. created a solr.xml under tomcat for the solr app: file: /usr/local/tomcat/conf/Catalina/localhost/solr.xml
<?xml version="1.0" encoding="utf-8"?>
<Context docBase="/var/www/projects/solr-oncars/example/solr/solr-4.4.0.war" debug="0" privileged="true" allowLinking="true" crossContext="true">
<Environment name="solr/home" type="java.lang.String" value="/var/www/projects/solr-oncars/example/solr" override="true" />
</Context>
4. copy solr.war to core's home-path
cp /var/www/projects/solr-oncars/example/webapps/solr.war /var/www/projects/solr-oncars/example/solr/oncars/
even tried with solr-4.4.war
cp /var/www/projects/solr-oncars/dist/solr-4.4.0.war /var/www/projects/solr-oncars/example/solr/
5. Edit solrconfig.xml
5.a : I have tried editing the datadir in solrconfig.xml
from :
<dataDir>${solr.core0.data.dir:}</dataDir>
to:
<dataDir>${solr.core0.data.dir:/var/www/projects/solr-oncars/example/solr/oncars/data}</dataDir>
5.b I have also tried after reverting the above setting
6. copy slf4j jars to tomcat: Encountered lots of sl4j errors in catalina logs when I tried to start solr app from tomcat manager. This was resolved by copying sl4j libraries from solr to tomcat. As given below:
cp -v /var/www/projects/solr-oncars/example/lib/ext/slf4j-* /usr/local/tomcat/lib/
cp -v /var/www/projects/solr-oncars/example/lib/ext/log4j-1.2.16.jar /usr/local/tomcat/lib/
from 1 to 6 were done to execute existing solr from tomcat. Under Tomcat Manager, '/solr' shows as started. Stop and Start of the same does not throw errors.
I can see that solr folder is created under webapps in tomcat:
ll webapps/solr/
output:
-rw-r--r-- 1 tomcat tomcat 5642 Jul 10 11:11 admin.html drwxr-xr-x 3 tomcat tomcat 4096 Sep 19 18:53 css -rw-r--r-- 1 tomcat tomcat 1146 Jul 10 11:11 favicon.ico drwxr-xr-x 4 tomcat tomcat 4096 Sep 19 18:53 img drwxr-xr-x 4 tomcat tomcat 4096 Sep 19 18:53 js drwxr-xr-x 2 tomcat tomcat 4096 Sep 19 18:53 META-INF drwxr-xr-x 2 tomcat tomcat 4096 Sep 19 18:53 tpl drwxr-xr-x 3 tomcat tomcat 4096 Sep 19 18:53 WEB-INF
When clicked on /solr from tomcat manager i.e. URL: http://localdomain.com:8400/solr/ The following page shows up:
HTTP Status 503 - Server is shutting down type Status report message Server is shutting down description The requested service is not currently available. Apache Tomcat/6.0.37
SOLR CONFIG: /var/www/projects/solr-oncars/example/solr/solr.xml :
<?xml version="1.0" encoding="UTF-8" ?>
<solr persistent="true">
<cores adminPath="/admin/cores">
<core schema="schema.xml" name="oncars" instanceDir="oncars" conf="solrconfig.xml"/>
</cores>
</solr>
I have tried looking around the web for help, but I couldn't find any that worked. Even resources from serverfault