MongoDB Installation and startup (CENTOS7)

Source: Internet
Author: User
Tags auth

Company Migration MongoDB, check a half-day data, a variety of textual research, all kinds of information, finally I choose very savage directly to the library and log directly to the SCP came ....

Note How to install and start MongoDB:

1. Unzip the MongoDB:

tar -zvxf mongodb-linux-x86_64-2.6. 4. gz

2. Enter MongoDB to set user name password:

[Email protected] bin]#./2.6. 4 connecting to:test> Use adminswitched to DB admin> AddUser (' abc', 'abc ')

3. Turn on MongoDB after exiting: (Default port: 27017)

./mongod--dbpath/data/mongodb/data--logpath/data/mongodb/mongodb.log-auth--fork

-auth: Requires authentication to enter.

--fork: Runs in the background.

--dbpath: Make data storage location

--logpath: Log storage location

4. Set up auto-run:

Echo " /home/mongodb-linux-x86_64-2.6.4/bin/mongod--dbpath/data/mongodb/data--logpath/data/mongodb/mongodb.log- Auth--fork" >>/etc/rc.local

5. Close can not forcibly kil, may be problematic, to be gentle: into MongoDB execution:

> Db.shutdownserver ()

Linux anything in the form of a file for me such a rib, is simply welfare ah ~ ~

By the way, when the pressure test, even if you want to test the real environment, but also to re-build an environment like ~ ~, or hang it is embarrassing .... I'm retarded enough to say that.

MongoDB Installation and startup (CENTOS7)

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.