Solr and Tomcat Upgrade Checklist

I’m in the happy position of running the most current releases of Solr and Tomcat on my Linode Virtual Ubuntu Server. Not only that, but my public server is now identical to my development environment configuration for Solr and Tomcat making upcoming application updates a snap.

I thought it would be helpful to create a checklist of the issues I need to address when upgrading Solr and Tomcat to eliminate problems in the future. Here’s my new Solr Dashboard displaying 4.10.4 and at the bottom its 8.0.30 Tomcat configuration.

1. Update Solr Indexes

First thing to do is update any Solr Indexes locally that are running on the VPS. If you go to NixMashup Links and do a search, you’ll be hitting one of those Solr Indexes. I like duplicating my production environment as much as possible, so I first made sure all indexes were running locally in Solr 4.10.4.

Solr Index Upgrade approach tip #1: take an example Collection conf/schema.xml and replace the fields and copyField elements using Meld or some other Linux Comparison app with those from the VPS Index. This results in a flawless Collection upgrade 99% of the time unless you’ve got other customizations in your schema.xml. This is definitely recommended when upgrading to Solr 5.x. (I successfully upgraded to v5.3.1–my primary intention, but had too many Spring-related problems so stayed with v4.x. Specifically, Solr Url access was fine, Embedded Solr, not so much.)

Solr Index Upgrade approach tip #2: Let Solr Core Admin load the Collection being upgraded. First remove the Collection’s file. Then Optimize the Index in Solr Core Admin and you’re good to go.

2. Secure the Solr Administration Server

You don’t want anyone to be able to access your Solr Server, so add a Tomcat Manager role in your Solr Administration Webapp’s WEB-INF/web.xml file. I blogged about that in Securing Your Public Solr Server.

3. Solr Dashboard Display

Easy to forget, you’ll want to change the Administration’s Context Path to avoid a common issue (common for me, anyway) of the Solr Administration Dashboard not displaying. I blogged about that in When Your Solr Admin Dashboard Won’t Load.

4. Add Tomcat Support JARs to Solr Webapp

For Solr to run with Tomcat we need a few JARs in the class path. We could put them in the Tomcat /lib folder (which I used to do) or we could put them in the Solr Administration Webapp’s WEB-INF/lib folder. Adding them to the Solr Webapp avoids the Java runtime errors of multiple Logging libraries in path. Below are the four files you want in Solr.

5. Adding the SOLR.XML as a Tomcat Localhost

Apache2, Tomcat and Solr have a different configuration than most Java Website configurations. For one thing, Tomcat wants a conf/Catalina/localhost/solr.xml file. Since this post is primarily a checklist, you can read about the details in my post Solr and Tomcat.

6. Prevent Catalina.out Log File Growth Problems

This is important! You want to make sure you modify the Tomcat logging file so you don’t have to double your VPS disk size (and monthly bill) like I did. Update the Tomcat conf/ file to prevent output to Console, or logs/catalina.out. Read more in Keeping Your Tomcat Catalina.out Logging File Small.

7. Add Tomcat Administrative Users

Secure Tomcat by adding your Tomcat conf/tomcat-users.xml. You should probably do this earlier than step 7, but make sure it’s on the checklist.

8. Soft Links to Java Sites in Tomcat Webapps

When updating Tomcat we can’t forget adding soft links in the Tomcat /webapps folder to the Java Sites on the Server. Here’s an old photo displaying a Java app link.

9. Apache2 Available-Sites CONF File Updates

With the location of Tomcat changed, need to update any .CONF files in Apache2.

Until Next Upgrade…

Hopefully I didn’t miss anything in the Solr and Tomcat Upgrade Checklist. If I did I’ll let you know after the next upgrade!