MongoDB Linux 安装配置 后台运行
介绍安装的文档很多,可以参考这篇:
http://www.mkyong.com/mongodb/how-to-install-mongodb-on-mac-os-x/
安装完后你可能会碰到的2个问题。
mongod --fork --logpath /var/log/mongod.log
--fork
This command-line option requires that you also specify a file to log messages to (since it can not use the current console). An example of this command looks like:
mongod --fork --logpath /var/log/mongod.log
You could put this into an /etc/init.d/mongod bash script file. And then to have the service run at startup, create the standard symbolic links (S## & K##) inside of /etc/rc#.d/. Here is a tutorial that explains this process in more detail. Scroll down to the section titled "Init Script Activation". This also has the added benefit of being able to execute commands like...
service mongod status
service mongod start
service mongos stop
2.执行mongod —fork —logpath /var/log/mongod.log 出错
about to fork child process, waiting until server is ready for connections. forked process: 10293 child process started successfully, parent exiting
这是因为当前用户对日志目录/var/log的权限不足
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。