Using virtual machines to build mongod development environment under Ubuntu

Source: Internet
Author: User
Tags mongodb server

Recently in the toss MongoDB and Nodejs, in Imooc found a MongoDB introductory tutorial, follow the inside step by step, the following record my operation steps and encountered problems.

First, using VirtualBox to install Unbuntu, I use the version of 14.10.

Second, download Monogdb source code, the website is: http://www.mongodb.org/downloads

Third, unzip and compile the source code.

    • Decompression command TAR-VXF Mongodb-src-r2.8.0-rc5.tar
    • Compile command scans all. If your computer CPU has a multi-core, you can use the scans All-j core number (such as 2, 4, etc.) to speed up the compilation, I only use a core, the result is very slow. I mainly want to experience the process of compiling, you can also directly download the compiled binary files.

Four, compiled good common procedure introduction.

    • Mongod-mongodb database execution program, using it for database deployment operations
    • MONGO-client program to connect to the MongoDB database
    • Import and export of Mongoimport MONGOEXPORT-MONGODB database
    • Mongodump Import and export of Mongorestore-mongodb database binaries, often used for backup and recovery operations

Five, build a simple MongoDB server

    • Create a directory structure
    • Copy the Mongod file to the bin directory: CP.. /mongod-linux-x86_64-2.6.7/bin/mongod bin/
    • Create configuration file mongod.conf:
      1 port = 123452 dbpath = data3 logpath = Log/mongod.log4true
      Where port is the port number of MongoDB, DBPath is the storage path of the database file, data represents the data directory under the current folder, LogPath is the save path of the log file, the Fork property indicates whether the background is started
    • 1

Using virtual machines to build mongod development environment under Ubuntu

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.