I did a bit of digging around and only found a handful of long procedures like say the one on Digital Ocean for Ubuntu 14, which actually is pretty good. But there is still an awful lot of things to keep in mind. I dug up the usual sources, but found no script that would actually automate the entire process from Java through install to core creation.

I wrote an end-to-end Solr installer script for RedHat and was wondering if there is one for Ubuntu I may have missed? Or should I actually devote some time and write it myself?


Check out Geerling Guy's Ansible role for Solr: https://github.com/geerlingguy/ansible-role-solr

It does everything you want, with very little effort.

That being said, here's what I used to run before I started using Ansible. This works for both Solr 5 and 6 on Ubuntu 14, Ubuntu 16, and RHEL 6.

I never bothered to include anything to do with cores since that's beyond the scope of what I would normally be doing in my role, but you should be able to find that fairly easily, and append it:

#!/bin/bash -eu    

[ $EUID -eq 0 ] || {
    echo "This script requires root or sudo"
    exit 1

# Solr depends on Java
apt-get install -y default-jre || sudo yum install -y java-headless

# Look up most recent version at http://archive.apache.org/dist/lucene/solr/

wget "http://archive.apache.org/dist/lucene/solr/$SOLR_VERSION/solr-$SOLR_VERSION.tgz"

# Extract just the install script from the bundle
tar xzf "solr-$SOLR_VERSION.tgz" "solr-$SOLR_VERSION/bin/install_solr_service.sh" --strip-components=2

./install_solr_service.sh solr-$SOLR_VERSION.tgz

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.