You might want to install multiple Solr instances simultaneously when it's necessary to enable independent searches for multiple Telligent Community sites, such as when you have a single server hosting development and staging, but don't want to purchase or use another server.

The assumptions in this procedure are that:

  1. You have a working, viable installation of Tomcat 6.0. If you do not have it, install the right version
  2. You are going to make at least two Solr instances (such as "Solr1" and "Solr2"), but this number could be increase to any number of instances your server can support.
  3. You've installed Solr at the default location - c:\Program Files\Apache Software Foundation\Tomcat 6. If you planned a different location, always replace the directory values in these commands with your correct installation path.
  4. You plan to run the same version of Solr on all instances. Even though you are running the same version of the software in each instance, you can still configure and/or customize each one differently.

Set up at least one Solr instance

The instructions have been adapted from documentation on multiple Solr application installations. If you already have one running instance of Solr, skip to If you already have a Solr instance.

  1. From your extracted Telligent Community download ([community download]), locate the Search folder.  You will use the contents of this folder in later steps.  
  2. Stop the Tomcat service using the Tomcat tray icon or the Service Manager (Start > Run > Services.msc - look for "Apache Tomcat").
  3. Create two directories for each Solr instance, for example c:\solr\solr1 and c:\solr\solr2, and then copy the contents from community download]\Search\solr directory to both c:\solr\solr1 and c:solr\solr2.
  4. Copy [community download]\Search\solr.war to the Tomcat lib directory - c:\Program Files\Apache Software Foundation\Tomcat 6.0\lib.
  5. Make a new text file in c:\Program Files\Apache Software Foundation\Tomcat 6.0\conf\Catalina\localhost called solr1.xml with the following code fragment:
    <Context docBase="C:\Program Files\Apache Software Foundation\Tomcat 6.0\lib\solr.war"
    debug="0" crossContext="true" >
       <Environment name="solr/home" type="java.lang.String"
    value="c:\solr\solr1" override="true" />
    </Context>
  6. The Catalina\localhost directory might not exist, so you might need to create it. Do not forget about the Catalina directory.
  7. Make a new text file in c:\Program Files\Apache Software Foundation\Tomcat 6.0\conf\Catalina\localhost called solr2.xmlwith the following code fragment:
    <Context docBase="C:\Program Files\Apache Software Foundation\Tomcat 6.0\lib\solr.war"
    debug="0" crossContext="true" >
       <Environment name="solr/home" type="java.lang.String"
    value="c:\solr\solr2" override="true" />
    </Context>
  8. Important: If you plan on querying Solr using international characters, refer to URI character set configuration for additional configuration information.
  9. Recommendation: If you have a medium- to large-sized community, you should increase the memory allocated to the Java Virtual Machine. The default allocated memory is 64MB; you should consider giving it 512MB or more. To increase the memory for the JVM:    
    1. Right-click the Tomcat Manager in the system tray.
    2. Select the Java tab.
    3. Set the Maximum memory pool size (in MB) that you want to allocate to the JVM.
  10. Start the Tomcat service using the Tomcat tray icon or the Services Manager (Start > Run >Services.msc and look for "Apache Tomcat").
  11. Go to each instance's admin page to verify that the installation is working - http://localhost:8080/solr1/admin and http://localhost:8080/solr2/admin. Verify that the 'SolrHome' value for each instance is pointing to its respective directory. (Do this by checking the address in the browser's address bar.)

Configure a Telligent Community server to use a specific instance of Solr

  1. Download the following communityserver_override.config file.
  2. Place this file in the root of your Web site directory.
  3. Find the following section in the communityserver_override.config file and replace the highlighted URL with the URL to your Solr instance.
    <Override xpath="/CommunityServer/Search/Solr"  
              mode="change"
              name="host"
              value="http://yourserver:XXXX/PathToSolr/"
              />

This URL is case-sensitive.

If you already have a Solr instance, transfer the current instance

  1. Stop Tomcat by clicking the Tomcat tray icon or closing it in Service Manager (Start > Run > Services.msc and look for "Apache Tomcat").
  2. Create a location to host your existing instance - such as c:\solr\solr1. Note: This step is technically not required because you can configure Tomcat to look at the existing path. But for ease of management, our recommendation is to keep the instances next to each other.
  3. Move (do not copy) the files from your current Solr home directory to c:\solr\solr1. In a typical instance this current home location might be c:\Program Files\Apache Software Foundation\Tomcat 6.0\Solr. Move them to the new directory as just described. Now that the existing Solr directory is empty, delete it.
  4. Open the c:\Program Files\Apache Software Foundation\Tomcat 6.0\Webapps folder and do the following:  
    1. Delete the Solr folder.
    2. Move solr.war to the Tomcat lib folder, c:\Program Files\Apache Software Foundation\Tomcat 6.0\lib.
    3. Ensure that nothing related to Solr is still left in the webapps directory.
  5. Continue with setting up the Solr instances and assume this instance is "SOLR1."

Troubleshoot an installation of multiple Solr instances

  1. Having already created two or more instances of Solr, ensure that they do not have duplicate names.
  2. Before creating the solr1.xml configuration text file (using the code fragment), ensure that the Catalina\localhost directory already exists.
  3. When you edit the communityserver_override.config file to change the Solr host value, remember that the text entry is case-sensitive.
  4. After you move an existing Solr instance's files from its previous home directory to the new host directory, ensure that you delete the previous home Solr directory.