MongoDB Deployment Single node (i)

Source: Internet
Author: User

Deployment package: MONGODB-LINUX-X86_64-RHEL55-3.0.2.TGZ (360 cloud Disk: Https://yunpan.cn/cPgTGfXsmhHNw extract code DBF7)

The first step: upload the file to the Linux server

Second step: Unzip the file command for tar zxvf mongodb-linux-x86_64-rhel55-3.0.2.tgz

The third step: the extracted folder mongodb-linux-x86_64-rhel55-3.0.2, renamed to mongodb_3.0.2

Fourth step: Enter the mongodb_3.0.2 directory, the content is as follows:

Fifth step: Create a data store directory and log store directory and log storage files

A: Create data store directory mkdir db

B: Create log store directory mkdir log

C: Create a log store file Touch Log/mongodb.log

Sixth step: Create a Boot configuration file (in DB, log sibling directory, my server is the directory after mongodb_3.0.2 entry)

A: Create Conf folder mkdir conf

B: Create config file under the Conf folder Touch Conf/mongodb.config

Seventh step: Edit Mongodb.config content, add the following content

port=10253
Dbpath=. /db
Storageengine=wiredtiger
Wiredtigercachesizegb=1
Wiredtigerjournalcompressor=zlib
Logpath=. /log/mongodb.log
Logappend=true
Fork=true

The explanations are as follows:

Port for Boot

DBPath is the data storage path, which is the DB path in the fifth step: /For the meaning of the previous layer

Storageengine for MongoDB storage engine, after 3.0 version of the new features, can be implemented through the engine plug-in memory settings such as boot

WIREDTIGERCACHESIZEGB is the MongoDB memory setting, where I set the 1G, which can be used to limit the amount of memory that MongoDB consumes

Wiredtigerjournalcompressor compresses the data for the MongoDB engine so that the stored data can be compressed, for example, I see MongoDB data on the server only 40MB, but I export to find this data much larger, There are 250M of data from my local test.

LogPath is the log path in the fifth step. /For the meaning of the previous layer

Logappend in Append mode for error log (overwrite mode is used by default)

Fork to run MongoDB in a daemon way

After the add is complete, save the file.

Eighth Step: Start MongoDB

Enter the bin directory and execute the following command to start MongoDB

./mongod -f /home/自己的路径/mongodb_3.0.2/conf/mongodb.config

Wait a minute, show upstarted successfully就说明部署成功了

This single-node deployment is complete.

MongoDB Deployment Single node (i)

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.