mongodb的启动脚本!

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mongodb的启动脚本!相关的知识,希望对你有一定的参考价值。

#!/bin/sh
#chkconfig: 2345 80 90
#description: mongodb
start() {
/usr/local/mongodb-linux-x86_64-rhel70-3.6.6/bin/mongod -f /usr/local/mongodb-linux-x86_64-rhel70-3.6.6/bin/mongodb.conf
}

stop() {
/usr/local/mongodb-linux-x86_64-rhel70-3.6.6/bin/mongod -f /usr/local/mongodb-linux-x86_64-rhel70-3.6.6/bin/mongodb.conf --shutdown
}

case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
*)
echo $"Usage: $0 {start|stop|restart}"
exit 1
esac

以上是关于mongodb的启动脚本!的主要内容,如果未能解决你的问题,请参考以下文章

Mongodb 安装脚本(附服务器自启动)

mongodb启动脚本

mongodb服务启动脚本

centos 6.5怎么设置mongodb 3.0.6 开机自启动

使用Spring启动的DB2和MongoDB的Spring批处理

关于centos下开机自启动问题