Deploying Apache SOLR 4 on Windows Server 2012 in Windows Azure – Part 1
A lot of my customers are interested in running SOLR 4 on Windows Azure, and specially on Windows Server. I have seen some prebuilt images, but none of them address the scenario of building a real SOLR cloud infrastructure on Windows VM in Azure. I am starting this series in which I will show you how to deploy SOLR 4 to Windows Azure in different configurations. I have taken basic guidance from SOLR WIKI here.
Disclaimer: I am not a SOLR expert, but I am a Windows Azure expert. So, please forgive me if I make any SOLR configuration mistakes.
Scenario 1: Creating a Simple SOLR4 installation on Windows Azure
This is the simplest form of SOLR installation and the SOLR team has done a great job in making sure the basic functionality work out-of-the-box.
Step 1: Create a Windows Azure VM
1) Login to your Windows Azure subscription at http://windows.azure.com and select a new Windows Server 2012 VM
2) Next, choose a machine name and Administrator password for the VM. Also select the size of the VM. I have selected Extra Small because I just love Extra Small instances in Azure
3) On the next screen choose a unique name for your cloud service that will host the VM. This will create a new cloud service in your subscription. Also select/create a storage account and a region to save the .vhd that will host your VM
Note: In Virtual Machines, you must to host the Cloud Service and the VHD file in the same region (I have selected SoutheastAsia), otherwise the creation will fail later with a vague error message and you will be pulling your hair on mailing lists.
4) On the next screen, keep default values and click OK
Once the provisioning is complete, you will see the VM in “Running” state.
5) RDP into the VM by clicking the Connect button from the bottom menu of the page
6) Login to the VM. Yeah! its the same Windows Server you are used to
First thing, before I forget, turn that IESC off from the Server Manager otherwise you are screwed.
7) Install the latest JDK (not explanation needed here)
8) Create a directory C:\ddapplications and download SOLR 4 to that directory. Then extract it to the same directory
9) Open Command Prompt (Shortcut: Windows + R then type cmd) and navigate to C:\ddapplications\solr4.1.0\example
10) Run java –jar start.jar to start the SOLR server
SOLR just fires up like a missile. Very beautiful to watch.
If everything goes well, SOLR will be up and running on port 8983 (default port). You can access SOLR admin locally http://localhost:8983/solr
You should see the dashboard, collections, etc. the usual SOLR components without any surprises.
To access SOLR from outside, you will need a couple of more steps
- Open Windows Firewall (wf.msc ) and open the 80 input port
- Go to Windows Azure portal and add an endpoint with 80 as the external port and 8983 as the internal port.
Of course, for predictable point-click deployment, just deploy it using Dynamic Deploy. SOLR will be running for you
In the next post I will address second scenario: Moving SOLR index to external drive.