Last active
August 29, 2015 14:16
-
-
Save lysender/6d1b2571d34df0d1be9e to your computer and use it in GitHub Desktop.
Custom Script for Running of Mongo DB
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
#!/bin/bash | |
# | |
# chkconfig: - 80 15 | |
# description: mongodb | |
start() { | |
mongod --replSet myawesomedb --dbpath=/home/lysender/.local/mongo/db --fork --logpath /home/lysender/.local/mongo/db.log --logappend --nojournal --smallfiles | |
#mongod --replSet myawesomedb --dbpath=/home/lysender/.local/mongo/db2 --fork --logpath /home/lysender/.local/mongo/db2.log --logappend --port 28017 --nojournal --smallfiles | |
#mongod --replSet myawesomedb --dbpath=/home/lysender/.local/mongo/db3 --fork --logpath /home/lysender/.local/mongo/db3.log --logappend --port 29017 --nojournal --smallfiles | |
echo "Starting MongoDB"; | |
} | |
stop(){ | |
killall -9 mongod | |
rm -f /home/lysender/.local/mongo/db/mongod.lock | |
#rm -f /home/lysender/.local/mongo/db2/mongod.lock | |
#rm -f /home/lysender/.local/mongo/db3/mongod.lock | |
echo "Stopping MongoDB"; | |
} | |
restart(){ | |
stop | |
start | |
} | |
case "$1" in | |
start) | |
start | |
;; | |
stop) | |
stop | |
;; | |
restart) | |
restart | |
;; | |
*) | |
echo $"Usage: $0 {start|stop|restart}" | |
exit 1 | |
esac | |
exit $? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment