MongoDB Installation and Shell introduction

Source: Internet
Author: User

MongoDB Installation

MongoDB with cross-platform excellent features, providing support for the mainstream operating system, we can choose to download the corresponding installation package according to the operating system we use.


Figure 1.MongoDB support for each version of the operating system


MongoDB The installation on each operating system is simple, we only need to download the installation package, extract to a directory, and then specify the storage directory and execute Mongod , it can listen to the client's link request, the following is a brief introduction to the Ubuntu under the installation process:

Copy the downloaded installation package to a specific directory and unzip it

figure 2. copy MongoDB and unzip

Perform decompression MongoDB under the directory Bin/mongod , and through DBPath parameter specifies the data storage directory.

Figure 3. start the MongoDB server Side


figure 4. start MongoDB error, modify data directory permissions

Figure 4 we can see the MongoDB error when starting, modify the owner of the directory, and then restart MongoDB , start successfully < Span lang= "en-US" > 5 " shown.

Figure 5.MongoDB Startup Success

above the way to startMongoDBmode, you need to always open the command line terminal, if you accidentally close it,MongoDBthe process is closed. MongoDBprovides a backgroundDaemonway to start the way we just need to add parameters-Forkand the--logpathcan be.

MongoDB in the Shell

MongoDBcomes with aJavascriptshell, so that we can from the command line withMongoDBto interact. Through thisShellwe can perform administrative operations,

Check running instances, perform regular database operations, and so on.

through ctrl+alt+t Open terminal, then enter MongoDB , execution bin/ MONGO start Shell .

Figure 6. start the shell

Shell The database server is automatically linked at startup, so you need to make sure that the server is started.

Shell is a fully functional JavaScript interpreter, which can perform any of the JavaScript program.

Figure 7. executing javascript in the shell


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.