Skip to content

Instantly share code, notes, and snippets.

@landau
Created January 19, 2018 12:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save landau/d6aa4574288051caaf446ed5ced089cd to your computer and use it in GitHub Desktop.
Save landau/d6aa4574288051caaf446ed5ced089cd to your computer and use it in GitHub Desktop.
Run Solr5 Example
#!/usr/bin/env bash
#####################################################
# This script is compatible with SOLR 5|6.x only
#####################################################
SOLR_PORT=${SOLR_PORT:-8983}
SOLR_VERSION=${SOLR_VERSION:-5.3.1}
version=$SOLR_VERSION
dir="solr-$version"
file="$dir.tgz"
url="http://archive.apache.org/dist/lucene/solr/${version}/solr-${version}.tgz"
echo "Downloading solr $version..."
if [ -f $file ];
then
echo "file $file exists."
tar -zxf $file
else
echo "file $file does not exist. Downloading solr from $1..."
curl -O $url
tar -zxf $file
fi
echo "Downloaded!"
echo "Starting solr on port $SOLR_PORT..."
./$dir/bin/solr -p $SOLR_PORT -c -e schemaless
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment