MongoDB on Linux boot from boot

Source: Internet
Author: User
Tags install mongodb

1. Download MongoDB

2. Install MongoDB (install to/usr/local)

 1  tar -xzvf mongodb-linux-x86_64-< Span style= "COLOR: #800080" >2.4 . 9  .tgz  2  mv  mongodb-linux-x86_64-2.4 . 9   MongoDB  3  CD MongoDB  4  mkdir   db  5  mkdir   logs  6  cd bin  7  vi  mongodb.conf 
Copy the following code into mongodb.conf and save
1 dbpath =/usr/local/mongodb/db2 logpath =/usr/local/mongodb/logs/mongodb.log3 270174true5 nohttpinterface=true6true

3. rebind the configuration file address and access IP of MongoDB, execute./bin/mongod--bind_ip localhost-f/usr/local/mongodb/bin/mongodb.conf (as shown)

4, Boot automatically start MongoDB, edit/etc/rc.d/rc.local, add the following line after the file

1 /usr/local/mongodb/bin/mongod--config/usr/local/mongodb/bin/mongodb.conf

5, restart, test success

MongoDB on Linux boot from boot

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.