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
- Create Virtual Machine on Azure - Select Ubuntu 12.04 SLR image
- SSH to the VM (e.g.
ssh azureuser@testvm.cloudapp.net
). You must have provided the username and password during the creation of VM. - 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
- Untar the SOLR package:
> tar -vzxf solr-4.5.1.tgz
- Install java:
> sudo apt-get install openjdk-6-jdk
- Ready to run the default Solr:
> cd solr-4.5.1/example
> java -jar start.jar
- 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.
- 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:
- 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
- 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
- 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
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#.