Install, configure, and use MongoDB

Source: Internet
Author: User
Tags mongodb 32 bit mongodb server

1) download MongoDB
Http://downloads.mongodb.org/win32/mongodb-win32-i386-2.0.4.zip

2) set the MongoDB directory

Decompress it to D: \ and rename it to MongoDB. The path is D: \ MongoDB.

3) set the data file path

Create a data folder in D: disk and create a new DB folder in the data folder. Path: D: \ data \ DB

4) Start the MongoDB Service

Go to cmd
Prompt console,
D: \ MongoDB \ bin \ mongod.exe -- dbpath = D: \ data \ DB

<!--[if !supportLists]-->1.  <!--[endif]-->Mon Apr 16 08:50:54
<!--[if !supportLists]-->2.  <!--[endif]-->Mon Apr 16 08:50:54 warning: 32-bit servers don't have journaling enabled by def
<!--[if !supportLists]-->3.  <!--[endif]-->ault. Please use --journal if you want durability.
<!--[if !supportLists]-->4.  <!--[endif]-->Mon Apr 16 08:50:54
<!--[if !supportLists]-->5.  <!--[endif]-->Mon Apr 16 08:50:54 [initandlisten] MongoDB starting : pid=5084port=27017 dbpat
<!--[if !supportLists]-->6.  <!--[endif]-->h=d:\data\db 32-bit host=PC-201012302214
<!--[if !supportLists]-->7.  <!--[endif]-->Mon Apr 16 08:50:54 [initandlisten]
<!--[if !supportLists]-->8.  <!--[endif]-->Mon Apr 16 08:50:54 [initandlisten] ** NOTE: when using MongoDB 32 bit, you are
<!--[if !supportLists]-->9.  <!--[endif]-->limited to about 2 gigabytes of data
<!--[if !supportLists]-->10. <!--[endif]-->Mon Apr 16 08:50:54 [initandlisten] **       see http://blog.mongodb.org/post/13
<!--[if !supportLists]-->11. <!--[endif]-->7788967/32-bit-limitations
<!--[if !supportLists]-->12. <!--[endif]-->Mon Apr 16 08:50:54 [initandlisten] **       with --journal, the limit is lower
<!--[if !supportLists]-->13. <!--[endif]-->Mon Apr 16 08:50:54 [initandlisten]
<!--[if !supportLists]-->14. <!--[endif]-->Mon Apr 16 08:50:54 [initandlisten] db version v2.0.4, pdfile version 4.5
<!--[if !supportLists]-->15. <!--[endif]-->Mon Apr 16 08:50:54 [initandlisten] git version: 329f3c47fe8136c03392c8f0e548506
<!--[if !supportLists]-->16. <!--[endif]-->cb21f8ebf
<!--[if !supportLists]-->17. <!--[endif]-->Mon Apr 16 08:50:54 [initandlisten] build info: windows sys.getwindowsversion(ma
<!--[if !supportLists]-->18. <!--[endif]-->jor=6, minor=0, build=6002, platform=2, service_pack='Service Pack 2') BOOST_LIB
<!--[if !supportLists]-->19. <!--[endif]-->_VERSION=1_42
<!--[if !supportLists]-->20. <!--[endif]-->Mon Apr 16 08:50:54 [initandlisten] options: { dbpath: "d:\data\db" }
<!--[if !supportLists]-->21. <!--[endif]-->Mon Apr 16 08:50:54 [websvr] admin web console waiting for connections on port 2
<!--[if !supportLists]-->22. <!--[endif]-->8017
<!--[if !supportLists]-->23. <!--[endif]-->Mon Apr 16 08:50:54 [initandlisten] waiting for connections on port 27017

Default connection port of the MongoDB server: 27017

5) Use MongoDB as a Windows Service for random startup

Create the D: \ MongoDB \ logs \ MongoDB. Log File to store the MongoDB log file, and then install the system service:
D: \ MongoDB \ bin \ mongod -- dbpath = D: \ data \ dB -- logpath = D: \ MongoDB \ log

s\mongodb.log --install   
All output going to: D: \ MongoDB \ logs \ MongoDB. log creating service MongoDB. service creation successful. service can be started from the command line via 'net start "MongoDB "'. d: \> Net start MongoDB Mongo dB service has been started successfully. D:>
Note: To uninstall the service, run the command SC Delete MongoDB.

6) Client Connection Verification

Open a new cmd input: D: \ MongoDB \ bin \ Mongo. If the following prompt appears, you can start your MongoDB Journey:

<!--[if !supportLists]-->1.  <!--[endif]-->d:\mongodb\bin\mongo  
<!--[if !supportLists]-->2.  <!--[endif]-->MongoDB shell version: 2.0.4  
<!--[if !supportLists]-->3.  <!--[endif]-->connecting to: test  
<!--[if !supportLists]-->4.  <!--[endif]-->>

7) view MongoDB logs

View the D: \ MongoDB \ logs \ MongoDB. Log File to view the running status of MongoDB or troubleshoot it.

Source: From blog.

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: info-contact@alibabacloud.com 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.