Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Database \ MongoDB Study Notes (1) - Install MongoDB on Windows systems     - Bash difference in single quotes and double quotes (Programming)

- 10 tips daily Docker (Server)

- APR for Tomcat installation under Linux (Server)

- Analysis of Java in the deep copy and shallow copy (Programming)

- Perl loop (Programming)

- Build their own recursive DNS server (Server)

- Google open source TCP team repaired the Linux kernel TCP flaw (Linux)

- ORA-00845: MEMORY_TARGET not supported on this system Problem (Database)

- Stucts2 values on the page and how the attribute values corresponding to the Action (Programming)

- JavaScript event handling Detailed (Programming)

- Oracle RMAN backups of the control file backup (Database)

- Proficient in C / C ++ can also find a very good job (Programming)

- SME Linux network security policy server security (Linux)

- Java study notes: String (Programming)

- Upgrading KDE Plasma 5.3 in Ubuntu 15.04 (Linux)

- Use Redis as time-series database: why and how (Database)

- CentOS install video converter FFmpeg and cutting tools segmenter (Linux)

- Configure shared library PCRE (Linux)

- Spring Data JPA call a stored procedure examples (Programming)

- Use SecureCRT to transfer files between Linux and Windows (Linux)

  MongoDB Study Notes (1) - Install MongoDB on Windows systems
  Add Date : 2018-11-21      

This paper describes a method MongoDB installed on Windows systems.

MongoDB official website: http: //www.mongodb.org/, the latest version is 2.6.7.


From the beginning of version 2.2, MongoDB does not support Windows XP. Please use the latest version of windows to use the latest version of MongoDB.

If you are running any version of Windows Server 2008 R2 or Windows 7, install the hot fixes to address the use of a memory-mapped files on Windows problem.

Download and install

Official website provides 32-bit and 64-bit zip compression free installation package and msi installation package. After the download extract the zip to develop directory to use; msi click to run, there is no particular need to pay attention. Both the installation is very simple, we need to choose your operating system to download and install the appropriate version, does not enumerate here.

32-bit and 64-bit difference: 32 The biggest mongodb 2G only store data, 64 there is no limit.

I used the operating system is windows 7 x64, MongoDB 2.6.7 is the latest 64-bit compressed package, extract the path to D: \ mongodb.

Create a database path

Before you start MongoDB service, you must manually create a database file to hold the folder, otherwise not start.

As apparent from the error message is because the default database path dbpath (\ data \ db \) does not exist, we need to create this directory or specified directory in --dbpath in.

As used herein, the default path for presentation, the command to create a \ data \ db \ directory, which is the position where the letter mongodb under the root directory, ie D: \ data \ db.

D: \ mongodb> md \ data \ db \
Configuration environment variable

In order to be more convenient MongoDB command operations, we also disposed of its environment variables. Operation is also very simple to Windows 7, for example, the computer -> right-click menu "Properties" to open the "System Properties window" -> "Advanced System Settings" -> "Advanced" tab -> Environment Variables, values ​​in the system variables path The last increase in "D: \ mongodb \ bin", after saving to re-open a command prompt window, do not need to enter D: \ mongodb \ bin directory to quickly perform mongodb, mongo MongoDB and other commands.

Start MongoDB service

If the data path is the default \ data \ db, in the command prompt window, start the MongoDB service by mongod.exe or mongod command.

D: \ mongodb \ bin> mongod
mongod --help for help and startup options
2015-02-07T19: 52: 55.252 + 0800 [initandlisten] MongoDB starting: pid = 6000 port = 27017 dbpath = \ data \ db \ 64-bit host = fanqi-s550c
2015-02-07T19: 52: 55.253 + 0800 [initandlisten] targetMinOS: Windows 7 / Windows Server 2008 R2
2015-02-07T19: 52: 55.253 + 0800 [initandlisten] db version v2.6.7
2015-02-07T19: 52: 55.253 + 0800 [initandlisten] git version: a7d57ad27c382de82e9cb93bf983a80fd9ac9899
2015-02-07T19: 52: 55.253 + 0800 [initandlisten] build info: windows sys.getwindowsversion (major = 6, minor = 1, build = 7601, platform = 2, service_pack = 'Service Pack 1') BOOST_LIB_VERSION = 1_49
2015-02-07T19: 52: 55.253 + 0800 [initandlisten] allocator: system
2015-02-07T19: 52: 55.253 + 0800 [initandlisten] options: {}
2015-02-07T19: 52: 55.256 + 0800 [initandlisten] journal dir = \ data \ db \ journal
2015-02-07T19: 52: 55.257 + 0800 [initandlisten] recover: no journal files present, no recovery needed
2015-02-07T19: 52: 55.277 + 0800 [initandlisten] waiting for connections on port 27017
If the data path is another path, you need to increase --dbpath parameter specifies the path. Note that there is a space in the path, then you will need to have to use the entire directory in double quotes, otherwise it will error.

D: \ mongodb \ bin \ mongod.exe --dbpath D: \ mongodb \ data \ db
 Information can be learned from the start by default MongoDB port 27017 waiting for a connection, we can use a browser to access "http: // localhost: 27017" view related information.

Add the MongoDB service windows service

In order not to each use MongoDB through cd, mongod complicated commands to start the service, we can add it to the windows service, using the following command:

D: \ mongodb \ bin> mongod --dbpath = D: \ data \ db --logpath = D: \ mongodb \ logs \ mongod.log --install --serviceName MongoDB
D: \ mongodb \ bin> net start MongoDB
MongoDB service has started successfully.
D: \ mongodb \ bin> net stop MongoDB
MongoDB service was stopped successfully.
among them:

--dbpath: specify the database path

--logpath: Specifies to save the log file path

--install: Install windows services

--serviceName: Setting MongoDB service name

net start MongoDB: start MongoDB service

net stop MongoDB: Stop MongoDB service

After the operation, we open the windows service management interface, you can see "MongoDB" service, and then how to set believe we know everything.
- MySQL use the integer type (Database)
- Ubuntu and Archlinux install Notepadqq 0.50.2 (Linux)
- GitLab issued Merge Request return error 500 when the two solutions log (Linux)
- CentOS 6.6 x64 Oracle Database 11gR2 RAC automated installation scripts (Database)
- RedHat yum configuration and the prompt (Linux)
- Android Application Development: an argument between Activity (Programming)
- Additional SQL Server 5123 database reported error (Database)
- SUSE Linux firewall configuration notes (Linux)
- Use Observium to monitor your network and servers (Server)
- libnet list of functions (Programming)
- Six Ways to view slides can be implemented Android (Programming)
- lack of SWAP space during installation of Oracle (Database)
- MongoDB3.0.6 wiredtiger MMAPv1 (Database)
- Linux system with a firewall to prevent the DOS attack (Linux)
- Build Python3.4 + PyQt5.3.2 + Eric 6.0 development platform Ubuntu 14.04 (Server)
- Install and use automated tools Ansible in CentOS 7 (Linux)
- Use install_updates upgrade GAMIT / GLOBK (Linux)
- MySQL 5.6.26 source install (Database)
- Under CentOS using yum command to install the Task Scheduler crontab (Linux)
- Linux / CentOS 7.0 installation and configuration under Tomcat 8.0 (Server)
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.