Apache Solr as Windows service
Tuesday 09 February 2010 at 11:50 pmI'm planning a series on Lucene/Solr integration with NHibernate & Telerik Extensions for ASP.NET MVC in the coming weeks but thought this might interest those planning to use Solr on Windows.
Background
We're using Solr to meet search requirements for an enterprise sized application. Tightly coupled to our ORM (NHibernate) event listeners it's availability and readiness, for both search queries and data inserts/updates, is paramount.
Although our Solr instances run on linux boxes I wanted to give us the option of deploying to Windows boxes in a production environment, not to mention give our team one less thing to do in the morning - start it!
Considerations
- Fully-fledged Windows service with stop/start/restart
- Must be able to start upon boot (without user interaction)
- Handle unexpected shut-downs/hangs properly (& release javaw32.exe)
- Automatically restart in the event of failure
- Log output from the application console
- Some kind of notification in the event of failure (email)
Java Service Wrapper
The prospect of having to write this ourselves was quite daunting as the time/resource would quite frankly outweigh slapping another linux server in the data-centre. However after some searching I came across the Java Service Wrapper. Available in in many flavours (including a free community version) it both meets our needs and brings some extra features welcome in a production environment.
Read More