Getting started with Tomcat and Solr

posted in: solr, tomcat

Step 1: Download HDS

Apache Solr by default ships with a Jetty based Solr server in the “example” directory, but many people prefer Tomcat.
Configuring your own Tomcat server can be daunting, as can be seen by the large list of instructions on the Solr wiki, and problems often surface later due to incorrect configuration.

HDS (Heliosearch Distribution for Solr) is a pre-configured Tomcat Solr distribution. It’s a super-set of the normal Apache Solr distribution and is open source and free to use. It contains an additional server directory which has the Tomcat-based Solr server.

Step 2: Start the Tomcat based Solr server

$ cd server
$ bin/startup.sh

By default, this starts up a Solr server on port 8983, the same standard Solr port that the Jetty based server in “example” uses.

Step 3: Go!

You’re now ready to start using your Tomcat based Solr server!
To verify Solr is up and running, you can point your browser at the admin page:


                

At this point, you should be able to treat this as any other Solr server and follow more generic tutorials or getting started guides.

More Info

The scripts can be run from anywhere, and allow passing JVM args on command line (just like jetty) to make it easier to use and to allow multiple servers to run on the same box without editing configuration files. The start scripts also work around known JVM bugs that could otherwise cause crashing or index corruption.

Stopping a server

$ cd server
$ bin/shutdown.sh

Using a different port

$ cd server
$ bin/startup.sh -Dhttp.port=7574
$ cd server
$ bin/shutdown.sh -Dhttp.port=7574