Created
December 21, 2017 01:42
-
-
Save alexpacer/ef2d4376a7d2b314d478a636138b0a46 to your computer and use it in GitHub Desktop.
Mongodb config server startup script on CentOS: "/etc/rc.d/init.d/mongod-config"
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/sh | |
# | |
# mongodb Startup script for the mongodb _config_ server | |
# | |
# chkconfig: - 64 36 | |
# description: MongoDB Database Configuration Server | |
# processname: mongodb | |
#Source function library | |
. /etc/rc.d/init.d/functions | |
start(){ | |
echo -n $"Starting mongodb....:)" | |
daemon --user=mongod /usr/bin/mongod "--configsvr -dbpath /data/configdb --port 27019" | |
} | |
stop(){ | |
echo -n $"Stopping mongodb.....:(" | |
/usr/bin/mongod --shutdown --dbpath /data/configdb | |
} | |
restart(){ | |
/usr/bin/mongod --shutdown --dbpath /data/configdb | |
daemon --user=mongod /usr/bin/mongod "--configsvr -dbpath /data/configdb --port 27019" | |
} | |
case "$1" in | |
start) | |
echo "Start service mongod" | |
start | |
;; | |
stop) | |
echo "Stop service mongod" | |
stop | |
;; | |
restart) | |
echo "Restart service mongod" | |
restart | |
;; | |
*) | |
echo "Usage: $0 {start|stop|restart}" | |
exit 1 | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment