欢迎投稿

今日深度:

【MongoDB】Configure a Windows Service for MongoDB,mongod

【MongoDB】Configure a Windows Service for MongoDB,mongodbconfigure


In this blog, I will mainly attach great importantance to how to create a windows service for mongodb. The method described in the next is referred from the official website of mongodb. 

http://docs.mongodb.org/manual/tutorial/install-mongodb-on-windows/


  • First of all, create the folder and files that need to store db and log. if you forgot, you could view the above the blog. In my local machine,


  • create a configuration file 
create  a configuration file, this file can include any of the configuration options for mongod, but must include a valid setting for logpath. we can learn from the next picture that echo command promart. 

  • create the mongodb service. use the following command. and use command ’net start mongodb ‘ to start the service. 


in the meantime, we could use anther way to start service. 


  • use the command { net stop mongoDB} to stop this server or in the above service window.


WIN7下,将MongoDB作为 Windows 服务Install失败

这个问题我也遇到过,以管理员身份运行cmd,然后再执行以上命令就OK了。
 

在Linux系统上装有一个MongoDB数据库,怎配置成Linux系统上的为主,Windows系统上的MongoDB为从数据库?

在启动Linux上的mongodb时使用master参数,在windows上启动时使用slave参数试试。
不过官方文档推荐2.4以后都使用replica set,不要再使用主从复制了。
使用replica set需要3个以上的节点,可以设置两个或以上的数据节点,多个选举节点,节点数要是基数个,哪个节点时primary由系统自己决定就好。
没有试过在Linux和windows上同时打开mongodb。
开启mongodb的参数可以参考这里:
docs.mongodb.org/...tions/
主从复制信息参考这里:

docs.mongodb.org/manual/core/master-slave/
 

www.htsjk.Com true http://www.htsjk.com/shujukunews/3123.html NewsArticle 【MongoDB】Configure a Windows Service for MongoDB,mongodbconfigure In this blog, I will mainly attach great importantance to how to create a windows service for mongodb. The method described in the next is referred from the official we...
评论暂时关闭