I am using Solr for my front-end webapp and in order to install it in Ubuntu 10.04 I did a simply apt-get solr-jetty and everything was fine.

The problem now is that I need some new features of Solr that exist in the latest release of Solr, but the version of Solr in the ubuntu package is still at 1.4!

My question is how can I upgrade the Solr version to the latest? Can someone give me some tips how can I do that plz????

EDIT: or may how to make a clean install of Solr with Jetty..

EDIT: at the end wasn't so difficult to install Solr with an already installed Jetty in my VPS.In case that someone found it helpfull I followed the bellow steps:

Placed the solr.war file in the Dist folder in the webapps folder of jetty

Placed the example/solr folder into the /var/share/solr folder in my machine as the Solr home folder

Edited the solrconfig.xml and schema.xml into my needs

Finally in order Jetty knows where is the Solr Home Dir, I edited the Jetty file into the /etc/default directory, by uncomment the JAVA_OPTIONS var and add it the following option:
JAVA_OPTIONS="-Dsolr.solr.home=/var/share/solr $JAVA_OPTIONS"

and that's it. I am not sure about the last step if it is the best way to do it but since Solr is working, should be the right way (solr documentation says something about JNDI lookup but I didn't manage to find it out).

Cheers

UPDATE: playing with a small ubuntu machine in digitalocean i found this very useful article on how to install the latest solr version in ubuntu. Disclaimer: i am not working or have any relationship with digitalocean..

5 Answers
5

The best way to deal with mission critical packages like this on Ubuntu, is to ignore the Ubuntu packaging system entirely, and that includes Launchpad. They are always lagging behind because to them, SOLR is not important. It is the same with Erlang, RabbitMQ, Python, etc. I try to build these packages from source myself, and install them outside of Ubuntu's system, either in /usr/local or in /home/packagename.

SOLR 3.2 is available for download from apache.org as a ready to run package named apache-solr-3.2.0.tgz including jetty. You simply unzip wherever you want it. Change directories into the example directory and type java -jar start.jar.

You can then change the schema.xml etc. to meet your needs.

Because this is a Java package you don't need to mess around with building from source, because the same compiled package will run anywhere that java is installed.

In addition to the xml files for configuring SOLR, you will have to look at .properties files to change the jetty configuration such as the port number used.

If you have Java developers at your company, there is another way to deal with this. Simply refuse to install SOLR, period. SOLR is a Java app. The Java developers already have a continuous integration system that collects dependencies, bundles them up into JARs or WARs and deploys them to production servers. Tell them to take care of SOLR the same way. It is not much work for a Java developer to set this up because there is no coding to do, just packaging. Then you manage deployment of configuration changes the same way you would do it for any other Java app.

Only use the Ubuntu packages (or any other distro's packages) to play around and evaluate tools. When a tool becomes mission critical to your business, take control of it and deal with the "upstream developers" directly. No need for distro middlemen to muddy the waters.

And how do you deal with the other things in a production environment like init-scripts, logging, logrotation, etc.?
–
Martijn HeemelsJul 13 '11 at 14:28

@Martijn those are all systems admin issues. I do not view SOLR as a system service, but as a mission critical application installed on a server. I make sure that my application has a start script and a stop script which can be used by the admins to make an initscript. Loggin via syslog if it will be admin responsibility, or into an application file rotated by the application. Applications are add-ons to the system, not system services.
–
Michael DillonJul 14 '11 at 2:09

I don't see what the difference is, unless you work in an enterprise environment. I work as admin for an SMB and am building a Solr setup for our devs, but it makes me feel like Solr requires me to become a Java dev. I just want to install an up-to-date Solr, instead of writing init scripts, figuring out how Java logs, etc. Spent hours looking for Java best practices and scripts, only to find most people recommend you change directory and type java -jar start.jar. It shouldn't take me days to install an application.
–
Martijn HeemelsJul 15 '11 at 12:23

@Martijn: It wouldn't take you days to install it if you would get a developer to package it up for you first. Many open source projects target the developers of Operating System distros, not end users or even system admins.
–
Michael DillonJul 15 '11 at 15:27

True. Ubuntu's Solr package is still at 1.4, even for Oneiric. I'll see if I can prod the packagers to build a 3.3 version from upstream.
–
Martijn HeemelsJul 19 '11 at 21:28

I forget about package for solr and jetty. I use this script https://github.com/gagarine/solr-install (you have to adapt) with success on debian to automatize the installation. The script should work on other Linux distribution.

I tried that Oneiric PPA. It looks like the creator of that PPA tried to add multicore support but ended up with a PPA that's broken for both multicore and single-core use.
–
goofriderMar 2 '12 at 5:31