Setup VM with Solr i Azure

Guide to setting up a Solr server in Azure

Posted by Michael Sundstrøm on 2018-06-29

Since the solution is using Sitecore my guide is written for Windows users in mind.

I started out by creating an Ubuntu Server instance in Azure. I added http, https and SSH as Public inbound ports.

  1. Connect to the server using Putty

  2. Install Java on the server

    sudo apt-get install openjdk-8-jre
    

  3. Download the solr tar file (Find the version that works for you Sitecore version here)

    wget http://archive.apache.org/dist/lucene/solr/5.5.3/solr-5.5.3.tgz
    

  4. Setup the Virtual Machines firewall

    sudo ufw allow 8983
    

  5. Unpack the Solr tar file

    tar -vzxf solr-5.5.3.tgz
    

  6. Unpack the Solr tar file

    cd solr-5.5.3.tgz
    bin/solr start
    

  7. Setup Azure network settings Setting up the Azure network setting as shown here will make the server be available publicly for all the world to see. Consider setting up the appropriate CIDR settings to secure your server
    alt text

  8. Create a Solr Startup script (solr-start.sh)

    nano solr-start.sh
    

  9. Add the following to the file

    cd solr-5.5.3
    bin/solr start
    

  10. Save the file and add execute permission to the script.

    chmod +x solr-start.sh
    

  11. You can test the script simply by using this command

    solr-start.sh
    

  12. Add the shell script to crontab

    crontab -e
    
    Add the script to the file as shown below
    @reboot “CHANGE TO THE PATH TO THE SOLR-START.SH”
    

When done test that your Solr server is started with the OS by restaring the VM.

As you can see it is not that hard to setup a working Solr server in Azure.

Happy Searching…