本文共 847 字,大约阅读时间需要 2 分钟。
参考文档:
http://www.cnblogs.com/hanyinglong/archive/2016/07/21/5690611.html
conf文件:
dbpath = /usr/local/mongodb/dblogpath = /usr/local/mongodb/logs/mongodb.logport = 27017fork = truelogappend = truepidfilepath = /usr/local/mongodb/mongo.pid#nohttpinterface = trueshardsvr = true#directoryperdb = true#auth = truerest = true
唯一不同是自启动文件:
#!/bin/sh # chkconfig: - 64 36 # description:mongod case $1 in start) /usr/local/kencery/mongoDB/mongodb/bin/mongod --maxConns 20000 --config /usr/local/kencery/mongoDB/mongodb/bin/mongodb.conf ;; stop) /usr/local/kencery/mongoDB/mongodb/bin/mongo 127.0.0.1:27017/admin --eval "db.shutdownServer()" ;; status) /usr/local/kencery/mongoDB/mongodb/bin/mongo 127.0.0.1:27017/admin --eval "db.stats()" ;; esac
无认证,无防火墙可直接访问: