MongoDB is automatically started and installed on Linux

Source: Internet
Author: User

Decompress:

Decompress the compressed package and move the bin folder in the extracted folder to/usr/local/mongodb.

Create the directory mongodb/data/db and mongo/logs under home/tiantao /.

Create a file mongodb. log in logs

Use the root user to configure the/etc/rc. local file

Add/usr/local/mongodb/bin/mongod to the file -- dbpath/home/tiantao/mongodb/data/db -- logpath/home/tiantao/mongodb/logs/mongodb. log

Restart

Enter usr/local/mongodb/bin/mongo on the terminal

Test books can use databases

Use the command mv mongodb/usr/local

Create the data/db directory cd to the/home/tiantao/mongodb directory mkdir data

Cd data and then mkdir db

Create a logs directory cd to mongodb mkdir logs

Cd logs and then mkdir mongodb. log

Edit the/etc/rc. local file vi/etc/rc. local

Add/usr/local/mongodb/bin/mongod to the file -- dbpath/home/tiantao/mongodb/data/db -- logpath/home/tiantao/mongodb/logs/mongodb. log

Last reboot

Check whether/usr/local/mongodb/bin/mongo can access the database.

Check whether logs are written to/home/tiantao/mongodb/logs/mongodb. log.

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.