Oct 9, 2014

Installing multiple SOLR Instances in Tomcat on Same Server

  1. Make sure Java is installed on the machine.
  2. Install Apache Tomcat on port 8983 (or any other port) (Installed at location: D:\Apache)
  3. Open URL: http://localhost:8983 to check if installation is working
  4. Download any version of SOLR (in my case it 3.6.2 file apache-solr-3.6.2.zip)
  5. Stop Tomcat
  6. Unzip the SOLR and goto apache-solr-3.6.2\dist
  7. Copy the war file (apache-solr-3.6.2.war) to D:\Apache\webapps twice
  8. Rename the war files to solr.war and  solr-preview.war respectively
  9. Create a SOLR home folder (in my case at location D:\Apache\solr  and D:\Apache\solr-preview)
  10. Started and stopped Tomcat.
  11. Goto D:\Apache\webapps\solr\META-INF
  12. Create a context.xml file with content:
    <Context docBase="D:\Apache\webapps\solr.war" debug="0" crossContext="true">
      <Environment name="solr/home" type="java.lang.String" value="D:\Apache\solr" override="true" /> 
    </Context>
  13. Goto D:\Apache\webapps\solr-preview\META-INF
  14. Create a context.xml file with content:
    <Context docBase="D:\Apache\webapps\solr-preview.war" debug="0" crossContext="true">
      <Environment name="solr/home" type="java.lang.String" value="D:\Apache\solr-preview" override="true" /> 
    </Context>
  15. Copy all files from apache-solr-3.6.2\example\solr to both SOLR home folders D:\Apache\solr  and D:\Apache\solr-preview)
  16. Start Tomcat Service
  17. The solr instances will be available on the URL: http://localhost:8983/solr and http://localhost:8983/solr-preview
  18. To test the settings create a SOLR node in any of the SOLR instances. E.g. in Solr-preview. The new instance will be available only on Solr-preview instance



No comments: