zoukankan      html  css  js  c++  java
  • MongoDB 2.6安装

    Workaround to install as a service

    You can manually install 2.6.0 as a service on Windows from an Administrator cmd prompt.

    Assuming you have installed MongoDB using the MSI installer, the default path will be C:Program FilesMongoDB 2.6 Standard. If you have installed in an alternative directory you will need to adjust the paths as appropriate.

    Steps to install:

    1) Open an Administrator command prompt

    • Windows 7 / Vista / Server 2008 (and R2)
      • Press Win + R, then type "cmd", then press Ctrl + Shift + Enter.
    • Windows 8 / 8.1
      • Press Win + X, then press A.

    2. Make directories for your database and log files

    mkdir c:datadb
    mkdir c:datalog
    

    3. Create a configuration file. This file can include any of the configuration options for mongod, but at a minimum must include a valid setting for logpath:

    echo logpath=c:datalogmongod.log> "C:Program FilesMongoDB 2.6 Standardmongod.cfg"
    echo dbpath=c:datadb>> "C:Program FilesMongoDB 2.6 Standardmongod.cfg"
    

    4. Create the MongoDB service

    sc create MongoDB binPath= ""C:Program FilesMongoDB 2.6 Standardinmongod.exe" --service --config="C:Program FilesMongoDB 2.6 Standardmongod.cfg"" DisplayName= "MongoDB 2.6 Standard" start= "auto"
    

    Note that sc requires a space between "=" and the configuration values (eg "binPath= "), and a "" to escape double quotes.

    If this works you should see:

    [SC] CreateService SUCCESS
    

    5. Start the MongoDB service:

    net start MongoDB
    

    If successful you should be able to connect using the mongo shell. If the service did not start successfully, the log file should contain information to help you troubleshoot.

  • 相关阅读:
    Java基础小结
    Struts2
    Ajax
    IIS 调优、支持同时10万个请求
    sqlserver2014 数据完整备份、日志备份
    windows server 2016添加开机启动项
    FileZilla服务器
    Windows server 2016 设置多用户登陆
    centos7 调整XFS格式的磁盘容量大小
    IIS 500.19 0x8007000d 0x80070032 0x80070021 提示“执行此操作时出错”
  • 原文地址:https://www.cnblogs.com/jordan2009/p/3662155.html
Copyright © 2011-2022 走看看