Last active
October 16, 2018 21:58
-
-
Save daveed/e83a59453a385685075e to your computer and use it in GitHub Desktop.
start and stop solr on a local environment using bash scripting
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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