Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Upgrade/Update the Solr-Jetty ubuntu package?

Tags:

solr

ubuntu

jetty

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:

  1. Placed the solr.war file in the Dist folder in the webapps folder of jetty
  2. Placed the example/solr folder into the /var/share/solr folder in my machine as the Solr home folder
  3. Edited the solrconfig.xml and schema.xml into my needs
  4. 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..

like image 431
ArisRe82 Avatar asked Jun 21 '11 13:06

ArisRe82


2 Answers

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.

like image 196
Michael Dillon Avatar answered Sep 17 '22 11:09

Michael Dillon


the most straightforward way: file a merge request at launchpad (whoever maintains the debian package)

Or get the source, update it and build your own package

sudo apt-get build-dep solr
apt-get source solr
cd solr-*/

review the files under debian/ to see whether it contains the upstream source URL; Follow your common sense, or http://www.infodrom.org/Debian/doc/maint/Maintenance-pkgbuild.html#s9.5 to get the latest versions to build.

Prepare for some conflict resolution because Debian/Ubuntu frequently sprinkle their secret sauce in the form of patches/quilts; these might not work with a newer upstream tar ball

like image 39
sehe Avatar answered Sep 20 '22 11:09

sehe