Click here to Skip to main content
15,884,629 members
Articles / Hosted Services / Azure
Tip/Trick

Tutorial: Lucene/SOLR on Azure in 5 Minutes

Rate me:
Please Sign up or sign in to vote.
5.00/5 (3 votes)
3 Dec 2013CPOL2 min read 16.7K   1  
Running Lucene/SOLR on Windows Azure in 5 minutes

Introduction

This tip shows one how to setup Lucene/SOLR on Windows Azure running Ubuntu 12.04 SLR image in 5 minutes. Hopefully, this can help others to get their Solr up and running on Azure in no time.

Background

It is assumed that the readers are familiar with basic Linux, Lucene/Solr (http://lucene.apache.org/solr/) and know how to configure and setup SOLR on a single Linux box.

Pre-requisites

Before you continue with the next sections, it is advisable to read some basic information from the following links:

Steps

  1. Create Virtual Machine on Azure - Select Ubuntu 12.04 SLR image
  2. SSH to the VM (e.g. ssh azureuser@testvm.cloudapp.net). You must have provided the username and password during the creation of VM.
  3. Once you are on a shell console, download SOLR binary from a href="http://lucene.apache.org/solr/">here:
    > curl -O http://www.webhostingjams.com/mirror/apache/lucene/solr/4.5.1/solr-4.5.1.tgz
  4. Untar the SOLR package:
    > tar -vzxf solr-4.5.1.tgz 
  5. Install java:
    > sudo apt-get install openjdk-6-jdk 
  6. Ready to run the default Solr:
    > cd solr-4.5.1/example
    > java -jar start.jar
  7. Hits your Solr instance: http://<VM-DNS-Name>:8983/solr/browse. You should see the Solr UI up and running if all is setup correctly.
  8. Once you have verified your Solr instance run correctly per step 7, the next step shows you how to run Solr as a service on startup: 
    1. Create a solr-start.sh in default mount point /mnt (preferably to use durable Azure Drive):
      cd solr-4.5.1/example
      java -jar start.jar
    2. Add the solr-start.sh to cron job to be fired on startup:
      > crontab -e (enter) 

      Add the following line to the cron job list:

      @reboot /mnt/solr-start.sh 
    3. Reboot the VM, verify once again your Solr instance is running (see step 7).

NOTE: If you want to run Solr on top of durability storage, you can consider using Azure Drive and copy the Solr to the mounted Azure Drive. The instruction to attach Azure Drive can be found here.

History

  • First version of the tutorial

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
United States United States
Henry Tan was born in a small town, Sukabumi, Indonesia, on December 7th, 1979. He obtained his Bachelor of Computer System Engineering with first class honour from La Trobe University, VIC, Australia in 2003. During his undergraduate study, he was nominated as the most outstanding Honours Student in Computer Science. Additionally, he was the holder of 2003 ACS Student Award. After he finished his Honour year at La Trobe University, on August 2003, he continued his study pursuing his doctorate degree at UTS under supervision Prof. Tharam S. Dillon. He obtained his PhD on March 2008. His research interests include Data Mining, Computer Graphics, Game Programming, Neural Network, AI, and Software Development. On January 2006 he took the job offer from Microsoft Redmond, USA as a Software Design Engineer (SDE).


What he like most? Programming!Math!Physisc!Computer Graphics!Playing Game!

What programming language?
C/C++ but started to love C#.

Comments and Discussions

 
-- There are no messages in this forum --