The first step to download MongoDB:Download MongoDB version of Windows, with 32-bit and 64-bit versions, downloaded according to the operating system:http://www.mongodb.org/downloadsUnzip to the specified directory, such as E:/mongodb.The second stepis to create the DBPath:You must create a storage folder for the database files before you start the MongoDB
Series 1: Create a Windows service that is installable, can be started, can be stopped, and can be uninstalled (downmoon original)
Series 2: demonstrate a regularly executed windows service and debug (windows service) (downmoon)
S
Open the CMD window as an administratorWin7:Registration Service CommandCD C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727InstallUtil.exe D:\HardWareServerService.exe (Hardwareserverservice the name of the project)net start Computerservice (Computerservice is the name of the service) [This step I did also succeeded]Original Reference Address: http://blog.csdn.net/m
. Open http://localhost:27017 in the browser and you can see some of its related information.
4. Install MongoDB as Windows service
Using commands Mongod--logpath D:\xampp\mongodb\log\MongoDB.log--logappend--dbpath D:\xampp\mongodb\data--directoryperdb-- ServiceName
1. Write the Windows Services (Windows Service) program in VC2008
SOURCE Resource Download:/201604/yuanma/testservice_jb51.rar
New ATL Project under Vc2008-Select to create a "service" type of ATL Project Testservice, the following code will be generated,
Class Ctestservicemodule:public catlservicemodulet
2,
enter the other database below will say. Enter exit or CTRL + C to exit. 6. When the Mongod.exe is turned off, Mongo.exe will not be able to connect to the database, so each time you want to use the MongoDB database to open the Mongod.exe program, it is more troublesome, at this time we can install MongoDB as a Windows ser
. If there is an abnormal performance, you can reset it by restarting the MONGOsConfigure server failure: A shard cluster typically has three configuration servers, and if there are two failures, the remaining configuration servers become read-only and all split and equalization operations stop. This does not affect the read and write of the cluster, when the three configuration server is restored, the equalizer will stop the place where it starts to work againMONGOs failure: If the MONGOs proce
variables, you can open cmd, run MONGO anywhere, no need to go into MongoDB bin directory to run Create the log directory D:\MongoDB\log In console input:mongod--dbpath c:\mongodb\data--logpath c:\mongodb\log\MongoDB.log--install--servicename "MongoDB"-- Journal Then, enter
Today, when configuring MongoDB, Win10 encountered a small problem, the configuration for the service is always not configured, the results found that the following command is not running as an administrator, resulting in failure.
C:\WINDOWS\SYSTEM32>CD D:\Program Files\dev\mongodb\binC:\
ObjectiveToday introduces the use of a gadget. We all know that Windows service is a special kind of application, it has the advantage of being able to run in the background, relatively, it is more suitable for some applications that need to run without too much user intervention, which we call "service"Writing Windows
surface service has been started.
Do not close the current Console window. Start another console and enter mongo. Example:
Indicates that mongdb is successfully connected.
4. Use mongdb as a windows Service for random startup.
On the console, enter mongod.exe -- dbpath = D: \ mongodb \ data -- logpath = D: \
is limited to about2gigabytes of Datamon Dec A +: +: the[Initandlisten] * * See http://blog.mongodb.org/post/137788967/32-bit-limitationsMon Dec A +: +: the[Initandlisten] * * with--Journal, the limit is Lowermon Dec A +: +: the[Initandlisten]mon Dec A +: +: the[Initandlisten] DB version v2.0.2-RC2, pdfile version4.5Mon Dec A +: +: the[Initandlisten] git version:7d32bec61fd25e2d1e728e24d0d127a8a73e38e0mon Dec A +: +: the[Initandlisten] BuildInfo: Wind
Download MongoDB's tar packets and I'll put them in the/home directory.
Execute command
Cd/home
tar zxvf your mongodb.tar.gz file.
Then change the folder name to MongoDB to facilitate later operation
MV Your mongodb.tar.gz file MongoDB
Create a new data directory under the/home/mongodb/directory
Then execute the command to start the
[Durability] DurabilityThread started2015-09-25t15:54:09.294+0800I CONTROL[Initandlisten] MongodbStarting:Pid=2488Port=27017DBPath=C:\data\db64-Bit host=WIN-1vonbjoce882015-09-25t15:54:09.296+0800I CONTROL[initandlisten] Targetminos: windows 7/ windows server 2008 R2-09-25t15 :54:09.298+ 0800 I CONTROL [initandlisten ] db version V3. 0.6 ...
To run the
this MongoDB is installed, than imagined simple too DohaTo make MongoDB a Windows service:will be MongoDB installed as Windows The service is very simple and only needs to be added after the command line executed above --install
, and once again open a Cmd.exe Then open a Cmd.exe as an administrator Run such as the following command MD"C:\mongodb"MD"C:\mongodb\log"MD"C:\mongodb\data"Echo LogPath=C:\mongodb\log\mongo.Log> "C:\mongodb\mongod.cfg"Echo DBPath=C:\m
database. So every time you want to use the MongoDB database to open the Mongod.exe program, so it is more troublesome, at this time we can install MongoDB as a Windows service Or run cmd, go to the Bin folder and execute the following command > D:\mongodb\bin>mongod–dbpath
Preparations:
Download the right version of http://www.mongodb.org/downloads to official
Here we use mongodb windows 32bit
Decompress mongodb to the d: \ mongodb \ directory, and create a new directory db (for storing data) and a directory logs (for storing logs) in the mongodb
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.