Using the threshold so low MongoDB

Source: Internet
Author: User
Tags mongodb server

Currently in full swing MongoDB, its use threshold is so low (in this article, for example, Windows):

1, the website download installs the package

2, after installing MSI file, will see the working directory of MongoDB under C:\Program files\mongodb (actually it is green)

3, I used to organize it into their working directory, the C:\Program files\mongodb\server\3.0 copied to the E:\mongo3 (MongoDB's working directory is the main bin)

4, in order to facilitate the operation, the bin can be added to the system variable path

5. Open CMD (admin mode)

6. Register MongoDB as a Windows service and execute it in cmd:

Mongod--install--servicename "Mongo3"--servicedisplayname "Mongo3"--servicedescription "[email protected]"--dbpath "E:\mongo3\db"--port 10000--logpath "E:\mongo3\log\log.txt"

Explain:

(1) DB directory for storing database files, Log.txt for storing running logs (all manually created)

(2) The service name is "Mongo3" (then also used to remove from the service), the service list display name is "Mongo3", the service description is "[Email protected]" The three items are arbitrary

(3) The service port number is 10000 (random, less than 65535 can, of course, do not conflict with the existing port number, more than the probability of conflict is small)

(4) OK after the Windows service can see the MONGO3, it is automatic mode, but this does not start, you can manually

This way, your Windows is already a MongoDB server.

7, the command to delete the service is: Mongod--remove--servicename Mongo3

8, with the Client connection service (this machine for example):

MONGO--port 10000--host 127.0.0.1

You can then execute the operation instructions (available in the documentation or online collection)


In fact, the local MongoDB working directory can be copied to other machines, with the above steps to create a MongoDB server, similar to MySQL. I like this kind of simplicity and not simple products.

Of course, this is only the threshold, MongoDB also has a lot of advanced features need to learn curve, but as a stand-alone database to build a small application system, this is enough.





Using the threshold so low 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: 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.