Windows Platform Installation MongoDB

Source: Internet
Author: User
Tags mongodb server openssl openssl version

Windows Platform Installation Mongodbmongodb download

Official website:

    • Note: Windows XP systems are no longer supported after the MongoDB 2.2 release. The latest version also has no installation files for the 32-bit system.
    1. After downloading, double-click the file and follow the instructions to install it. During the installation process, you can set up your installation directory by tapping the custom button.
    2. Create data Directory MongoDB stores the data directory in the DB directory. However, this data directory is not actively created, and we need to create it after the installation is complete. Note that the data directory should be placed under the root directory (e.g. C: \ or D:\. , etc.). In this tutorial, we've installed MongoDB on the C: disk, now let's create a directory of data and then create the DB directory in the data directory.
c:\>cd c:c:\>mkdir datac:\>cd datac:\data>mkdir dbc:\data>cd dbc:\data\db>

You can also create these directories through the Windows Explorer, not necessarily through the command line.

Run MongoDB server under command line
    1. You can find the bin directory under MongoDB mongod.exe double click to run it directly.
    2. or run it using the command line, in order to run the MongoDB server from the command prompt, you must execute the Mongod.exe file from the bin directory of the MongoDB directory. Example: CD C:\Program Files\mongodb\server\3.4\bin re-execution: Mongod--dbpath c:\data\db If the following display indicates a successful run
2017-09-26t14:41:23.836+0800 I CONTROL [Initandlisten] MongoDB starting:pid=1176 port=27017 dbpath=c:\data\db\ 64-bit H ost=desktop-64mc4gg2017-09-26t14:41:23.841+0800 I CONTROL [Initandlisten] targetminos:windows 7/Windows Server 2008 r22017-09-26t14:41:23.841+0800 I control [initandlisten] DB version v3.4.92017-09-26t14:41:23.841+0800 I control [Inita Ndlisten] git version:876ebee8c7dd0e2d992f36a848ff4dc50ee6603e2017-09-26t14:41:23.841+0800 I CONTROL [Initandlisten ] OpenSSL version:openssl 1.0.1u-fips Sep 20162017-09-26t14:41:23.841+0800 I CONTROL [Initandlisten] Allocator:tcma lloc2017-09-26t14:41:23.841+0800 I control [Initandlisten] modules:none2017-09-26t14:41:23.842+0800 i control [ Initandlisten] Build environment:2017-09-26t14:41:23.842+0800 I CONTROL [Initandlisten] distmod:2008plus-ssl2017-09- 26t14:41:23.842+0800 I control [Initandlisten] distarch:x86_642017-09-26t14:41:23.842+0800 i control [initandlisten ] Target_arch:x86_642017-09-26t14:41:23.842+0800 i CONTROL [Initandlisten] options: {}2017-09-26t14:41:23.862+0800 i-[Initandlisten] detected data fi Les in C:\data\db\ created by the ' Wiredtiger ' storage engine, so setting the active storage engine to ' Wiredtiger '. 2017-0 9-26t14:41:23.864+0800 I STORAGE [Initandlisten] Wiredtiger_open config:create,cache_size=1474m,session_max=20000, Eviction= (threads_min=4,threads_max=4), config_base=false,statistics= (FAST), log= (Enabled=true,archive=true,path =journal,compressor=snappy), file_manager= (close_idle_time=100000), checkpoint= (WAIT=60,LOG_SIZE=2GB), statistics _log= (wait=0), 2017-09-26t14:41:24.964+0800 i control [initandlisten]2017-09-26t14:41:24.965+0800 i control [ Initandlisten] * * warning:access control is not enabled for the database.2017-09-26t14:41:24.965+0800 I control [Initand   Listen] * * Read and Write access to data and configuration is unrestricted.2017-09-26t14:41:24.965+0800 I CONTROL [initandlisten]2017-09-26t14:41:25.652+0800 I Ftdc [InitandlIsten] Initializing Full-time diagnostic data capture with directory ' C:/data/db/ ' 2017-09-26t14 : 41:25.661+0800 I NETWORK [thread1] waiting for connections on port 27017
To run the MongoDB server as a Windows service

The command line enters MongoDB's Bin directory to execute:

mongod.exe --bind_ip yourIPadress --logpath "C:\data\dbConf\mongodb.log" --logappend --dbpath "C:\data\db" --port yourPortNumber --serviceName "YourServiceName" --serviceDisplayName "YourServiceName" --install
    • --BIND_IP bind service IP, if bind, then only native access, do not specify default local all IP
    • --logpath the MongoDB log file, note that the specified file is not a directory (here folder dbconf for my own new)
    • --logappend writing the log using the Append method
    • --dbpath Specifying the database path
    • --port specifying the service port number, default port 27017
    • --servicename Specifying the service name
    • --SERVICEDISPLAYNAME Specifies the service name, which is executed when there are multiple MongoDB services.
    • --install is specified as a Windows service installation.
MongoDB Background Management Shell

If you need to get into MongoDB background management, you need to open the bin directory of the MongoDB directory first, then execute the mongo.exe file, MongoDB Shell is the interactive JavaScript shell that comes with MongoDB, An interactive environment that is used to manipulate and manage MongoDB. When you enter the MongoDB background, it is linked to the test document (database) by default, which is executed after the command line enters the bin directory: MONGO the following message appears to indicate success:

  MongoDB Shell version v3.4.9connecting to:mongodb:// server version:3.4.9welcome to the MongoDB shell. For interactive help, type ' help '. For more comprehensive documentation, see Try the support group Http:// have startup warnings:2017-09-26t14:41:24.96  4+0800 I control [initandlisten]2017-09-26t14:41:24.965+0800 i control [initandlisten] * * warning:access CONTROL is not Enabled for the database.2017-09-26t14:41:24.965+0800 I CONTROL [initandlisten] * * Read and write access to dat A and configuration is unrestricted.2017-09-26t14:41:24.965+0800 I CONTROL [Initandlisten]  
    • Since it is a JavaScript shell, you can run some simple arithmetic operations:

      > 2 + 2


      > 4+4


    • The DB command is used to view the document (database) of the current operation:

      > DB


Windows Platform Installation MongoDB

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.