Install mongodb and mongodb

Source: Internet
Author: User
Tags install mongodb

Install mongodb and mongodb

Install

1> set the mongoDB directory
[Root @ vm13 home] # cd/home/apps
Appendix: [root @ vm13 home] # mkdir-p/home/apps

2> upload the mongodb-linux-x86_64-2.4.11.tar file to the/home/apps directory.

3> decompress the file
[Root @ vm13 apps] # tar xzf mongodb-linux-x86_64-2.4.11.tar
Folder rename
[Root @ vm13 apps] # Music mongodb-linux-x86_64-2.4.11 mongodb

4> create directories and files
[Root @ vm13 apps] # mkdir-p mongodb/data/db
[Root @ vm13 apps] # mkdir-p mongodb/logs
[Root @ vm13 apps] # touch mongodb/logs/mongodb. logs

5> start the service
[Root @ vm13 apps] #. /mongodb/bin/mongod-dbpath =/home/apps/mongodb/data/db-logpath =/home/apps/mongodb/logs/mongodb. logs
All output going to:/home/apps/mongodb/logs/mongodb. logs

6> Add the mongoDB service to the random start
[Root @ vm13 apps] # vi/etc/rc. local
Use the vi editor to open the configuration file and add the following line of code
[Root @ vm13 apps] #/home/apps/mongodb/bin/mongod -- dbpath/home/apps/mongodb/data/db -- port 27017 -- logpath/home/apps/mongodb /logs/mongodb. logs -- logappend

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.