This is step 10 of performing a full installation of Enterprise Server 9. (See a list of all steps)
What is Solr?
Solr is an open source enterprise search server based on the Lucene Java search library. Some of its features include:
- XML/HTTP and JSON APIs
- Hit highlighting
- Faceted search
- Caching
- Replication
- A Web administration interface
How is Solr run?
Solr runs in a Java servlet container such as Tomcat or Jetty (included in the Solr distribution download).
Which version of Solr should be used with Enterprise Server?
Enterprise Server 9.2 and higher requires Solr 4.5.1 or higher to be installed (for exact compatibility information, see the Compatibility Matrix). Enterprise Server 9 ships with a separate Solr package that has been updated to Solr 4.5 standards.
Note: Enterprise Server 9.0 and 9.1 use Solr 3.6.
Language support
For most supported languages, the schema.xml and solrconfig.xml files are located in the root folder of the Solr package. For Chinese, Japanese, and Korean languages, the schema.xml and solrconfig.xml files of the “CJK" subfolder should be used instead.
Solr requirements
- Java 1.6 or greater installed
- A servlet container such as Tomcat, Jetty, or Resin
Note: We assume that you have Java 1.6 or greater installed and that Solr 4.5.1 or higher is used. Furthermore, we focus on installing Solr in the Tomcat servlet container. (There are several alternative ways for getting Solr up and running.)
Steps to follow
At high-level, the integration of Solr in Enterprise Server consists of the following steps (listed in the order in which they should be carried out):
1. Installing Solr
Step 1. Download the Apache Tomcat 7.x Binary Distribution file.
Step 2. Unpack the file to an installation directory, for example \Applications\Tomcat.
Note: From here on, this installation directory is referenced as <tomcat>.
Step 3. Edit the <tomcat>/conf/tomcat-users.xml file to:
<xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<role rolename="manager-gui"/>
<role rolename="standard"/>
<user username="woodwing" password="ww" roles="standard,manager-gui"/>
</tomcat-users>
Note: The user specified in “username” is needed to manage Tomcat; it is not an Enterprise user).
Step 4. Download Apache Solr 4.5.1 (recommended version) or higher from the Solr archive.
Note: Enterprise Server 9 ships with a separate Solr package that has been updated to Solr 4.5 standards. For exact compatibility information, see the Compatibility Matrix.
Step 5. Unpack the file to a temporary directory.
Note: From here on, this directory is referenced as <temp>.
Step 6. Copy the file apache-solr-4.5.x.war from <temp>/dist/ to <tomcat>/webapps/.
Tip: For ease of use, the file can be renamed to solr.war.
Step 7. Copy <temp>/example/solr to the installation directory \Application\Solr.
Note: From here on, this directory is referenced as <solr>.
Step 8. Copy the content of the <temp>/example/lib/ext folder to the Tomcat libs directory <tomcat>/lib.
Step 9. Restart Tomcat.
Step 1. Download the Java Virtual Machine 6.0.
Step 2. Download and install the Apache Tomcat 7.x Windows Service Installer.
Note: From here on, this installation is referenced as <tomcat>.
Step 3. Edit the <tomcat>/conf/tomcat-users.xml file to:
<xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<role rolename="manager-gui"/>
<role rolename="standard"/>
<user username="woodwing" password="ww" roles="standard,manager-gui"/>
</tomcat-users>
Note: The user specified in “username” is needed to manage Tomcat; it is not an Enterprise user.
Step 4. Download Apache Solr 4.5.1 (recommended version) or higher from the Solr archive.
Note: Enterprise Server 9 ships with a separate Solr package that has been updated to Solr 4.5 standards. For exact compatibility information, see the Compatibility Matrix.
Step 5. Unpack the file to a temporary directory.
Note: From here on, this directory is referenced as <temp>.
Step 6. Copy the file solr-4.5.1.war from <temp>/dist/ to <tomcat>/webapps/.
Tip: For ease of use, the file can be renamed to solr.war.
Step 7. Copy <temp>/example/solr to the installation directory C:\Solr.
Note: From here on, this directory is referenced as <solr>.
Step 8. Copy the content of the <temp>/example/lib/ext folder to the Tomcat libs directory <tomcat>/lib.
Step 9. Use the System Tray icon to configure Tomcat (Configure > Java) so that it starts with the following Java option:
-Dsolr.solr.home=<solr>
Step 10. Restart Tomcat.
Step 1. Download the Apache Tomcat 7.x Binary Distribution file.
Step 2. Unpack the file to an installation directory, for example /home/<username>/Tomcat.
Note: From here on, this installation directory is referenced as <tomcat>.
Step 3. Edit the <tomcat>/conf/tomcat-users.xml file to:
<xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<role rolename="manager-gui"/>
<role rolename="standard"/>
<user username="woodwing" password="ww" roles="standard,manager-gui"/>
</tomcat-users>
Note: The user specified in “username” is needed to manage Tomcat; it is not an Enterprise user).
Step 4. Download Apache Solr 4.5.1 (recommended version) or higher from the Solr archive.
Note: Enterprise Server 9 ships with a separate Solr package that has been updated to Solr 4.5 standards. For exact compatibility information, see the Compatibility Matrix.
Step 5. Unpack the file to a temporary directory.
Note: From here on, this directory is referenced as <temp>.
Step 6. Copy the file apache-solr-4.5.x.war from <temp>/dist/ to <tomcat>/webapps/.
Tip: For ease of use, the file can be renamed to solr.war.
Step 7. Copy <temp>/example/solr to the installation directory, for example \opt\Solr.
Note: From here on, this directory is referenced as <solr>.
Step 8. Copy the content of the <temp>/example/lib/ext folder to the Tomcat libs directory <tomcat>/lib.
Step 9. Restart Tomcat.
2. Configuring Solr
Step 1. Open the config_solr.php file.
- <Enterprise installation directory>/config/
Step 2. Verify if the correct URL is defined in the SOLR_SERVER_URL setting.
Example: define ('SOLR_SERVER_URL', 'http://localhost:8080/solr');
Step 3. Verify if the correct collection is defined in the SOLR_CORE setting.
Example: define ('SOLR_CORE', 'collection1');
Step 4. (Optional) Define the time-out duration in the SOLR_TIMEOUT setting.
Example: define ('SOLR_TIMEOUT', 5);
Note: Changing this value may be necessary when time-outs occur while indexing many objects. However, usually it is better to adjust the solrconfig.xml file by changing settings such as ramBufferSizeMB, mergeFactor, and autoCommit.
3. Starting Apache Tomcat
Step 1. Create a shell file in the Tomcat installation directory (as specified in the Solr installation).
Example: startupTomcatSolr.
Note: From here on, this shell file is referenced as <startup>.
Step 2. Add the following code:
#Set JAVA_HOME environment variable
export JRE_HOME="/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home"
#Set the Solr Current Working Directory
export JAVA_OPTS="-Dsolr.solr.home=<solr>"
#Switch to the bin directory
cd /<tomcat>/bin
#Startup Tomcat as a background process
./startup.sh &
Step 3. Open a Terminal and enter:
cd <tomcat>/bin
chmod a+rx *
Note: This is a brute force; it gives every user execute and read rights on the binaries.
cd <tomcat>
sudo ./<startup>
Note: When Tomcat is started, a directory named /solr/ is automatically created in /<tomcat>/webapps/.
Start the Tomcat service from the System Tray icon.
Step 1. Create a shell file in the Tomcat installation directory (as specified in the Solr installation).
Example: startupTomcatSolr.
Note: From here on, this shell file is referenced as <startup>.
Step 2. Add the following code:
#Set JAVA_HOME environment variable
export JRE_HOME="<enter the path to Java Home>"
#Set the Solr Current Working Directory
export JAVA_OPTS="-Dsolr.solr.home=<solr>"
#Switch to the bin directory
cd /<tomcat>/bin
#Startup Tomcat as a background process
./startup.sh &
Step 3. Open a Terminal and enter:
cd <tomcat>/bin
chmod a+rx *
Note: This is a brute force; it gives every user execute and read rights on the binaries.
cd <tomcat>
sudo ./<startup>
Note: When Tomcat is started, a directory named /solr/ is automatically created in /<tomcat>/webapps/.
4. Testing the Tomcat installation
Step 1. Enter the following URL in a Web browser: http://localhost:8080/.
The Tomcat page should appear.
Step 2. Open the Tomcat Manager.
Note: Use the username and password as specified in step 1 "Installing Solr" above. (In our example we used username “woodwing" and password “ww".)
Step 3. Open /solr (or apache-solr-4.5.x, if you did not rename the .war file).
Step 4. Open Solr Admin to confirm correct installation.
5. Installing the Enterprise schema
In this step, the default Solr schema file is e replaced by the Enterprise version.
Step 1. Unpack the file SolrEnterprise_9.x.x_Buildyz.zip that is delivered together with the Enterprise Server installation.
Note: This must be a file for Enterprise Server 9.2 or higher.
Step 2. Copy the file named schema.xml to <solr>/<corename>/conf/. Confirm that you want to overwrite the already existing schema.xml file.
Note: The core name is usually 'collection1'.
Step 3. Copy the file named solrconfig.xml to <solr>/<corename>/conf/. Confirm that you want to overwrite the already existing solrconfig.xml file.
Step 4. Do one of the following:
- Restart Tomcat server.
- On the admin page of Solr 4, click Reload for the same collection as the one referenced in step 2.
Before deploying Solr to your users, test the Solr installation and the integration in Enterprise Server.
Testing the installation
Step 1. To see if Solr is running, enter the following URL in a Web browser:
http://localhost:8080/solr
Step 2. Access the Tomcat Manager by using the following default credentials (or any other credentials that you have entered in the tomcat-users.xml file):
- Username: woodwing
- Password: ww
Testing the integration
Step 1. In Enterprise Server, access the Server Plug-ins Maintenance page in order to activate the Solr Search plug-in.
In Enterprise Server, click Server Plug-ins in the Maintenance menu or on the Home page.
Step 2. In Enterprise Server, access the Health Check page and run the Solr Search Server test.
Step 2a. In Enterprise Server, click Advanced in the Maintenance menu or on the Home page. A page with all advanced Maintenance features appears.
Step 2b. Click Health Check.
The Health Check page appears.
Step 2c. At the bottom of the page, click Clear All.
Step 2d. Select the test named Solr Search Server.
Step 2e. Click Test.
The test is executed and the result is displayed next to the test. It should display “OK”.
Note: If the test fails, an error is displayed together with instructions for solving it. Follow the instructions and then run the test once more.
Next step
Step 11. Configuring Enterprise Server 9
Reference Materials
Comment
Do you have corrections or additional information about this article? Leave a comment! Do you have a question about what is described in this article? Please contact Support.
0 comments
Please sign in to leave a comment.