配置文件内容:
[root@yoon etc]# cat
mongod.conf
logpath=/export/log/mongodb.log
logappend=true
fork = true
dbpath=/export/data/db
pidfilepath = /export/mongodb/etc/mongodb.pid
rest = true
httpinterface = true
port = 27017
脚本如下:
[root@yoon~]#
cd
/etc/init.d/
[root@yooninit.d]#
vi mongod
#!/bin/bash
# mongod - Startup script for mongod
# chkconfig: 35 80 15
# description: Mongo is a scalable, document-oriented database.
# processname: mongod
#config: /export/mongodb/etc/mongod.conf
[root@yoon etc]# cat
logpath=/export/log/mongodb.log
logappend=true
fork = true
dbpath=/export/data/db
pidfilepath = /export/mongodb/etc/mongodb.pid
rest = true
httpinterface = true
port = 27017
脚本如下:
[root@yoon
[root@yoon
#!/bin/bash
# mongod - Startup script for mongod
# chkconfig: 35 80 15
# description: Mongo is a scalable, document-oriented database.
# processname: mongod
#config: /export/mongodb/etc/mongod.conf