Skip to content

Instantly share code, notes, and snippets.

@daveed
Last active October 16, 2018 21:58
Show Gist options
  • Save daveed/e83a59453a385685075e to your computer and use it in GitHub Desktop.
Save daveed/e83a59453a385685075e to your computer and use it in GitHub Desktop.
start and stop solr on a local environment using bash scripting
alias solr_start='cd ~/sunspot-1.1.0/solr/ && java -Xms512M -Xmx1024M -Djetty.port=8982 -Dsolr.data.dir=/home/flashgordon/ruby-dev/sas/solr/data/development -jar start.jar'
# Custom function
function solr_stop() {
pids=$(ps aux | grep -v awk | awk '/java.*-Djetty.port=8982/' |cut -c10-15)
if [ "x${pids}" != "x" ]; then
for pid in $pids; do
kill -9 $pid
echo -e "\033[1;32m[OK] \033[00msolr stopped"
done
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment