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