Centso installation mongodb3.0

Source: Internet
Author: User

Installing mongodb3.0

Add MongoDB's software source files

In Terminal input command sudo touch/etc/yum.repos.d/mongodb-org-3.0.repo

650) this.width=650; "title=" clip_image002 "style=" border-left-0px; border-right-width:0px; Background-image:none; border-bottom-width:0px; padding-top:0px; padding-left:0px; padding-right:0px; border-top-width:0px "border=" 0 "alt=" clip_image002 "src=" http://s3.51cto.com/wyfs02/M00/70/06/ Wkiom1wvfwatmpeeaacb3mnkhh8693.jpg "width=" 604 "height=" 339 "/>

Edit MongoDB Software source file, add MongoDB software source

In Terminal input command Vim/etc/yum.repos.d/mongodb-org-3.0.repo

Then press the keyboard I key to copy the following information into the file

[mongodb-org-3.0]

Name=mongodb Repository

baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.0/x86_64/

Gpgcheck=0

Enabled=1

Then press the ESC key, press the colon key, enter Wq, return to save

650) this.width=650; "title=" clip_image004 "style=" border-left-0px; border-right-width:0px; Background-image:none; border-bottom-width:0px; padding-top:0px; padding-left:0px; padding-right:0px; border-top-width:0px "border=" 0 "alt=" clip_image004 "src=" Http://s3.51cto.com/wyfs02/M01/70/03/wKioL1WvgOujUMw_ Aadp3qc1u5s380.jpg "width=" 604 "height=" 448 "/>

Install MongoDB and components in the terminal by entering the following command

sudo yum install-y mongodb-org-3.0.4 mongodb-org-server-3.0.4 mongodb-org-shell-3.0.4 mongodb-org-mongos-3.0.4 mongodb-org-tools-3.0.4

650) this.width=650; "title=" clip_image006 "style=" border-left-0px; border-right-width:0px; Background-image:none; border-bottom-width:0px; padding-top:0px; padding-left:0px; padding-right:0px; border-top-width:0px "border=" 0 "alt=" clip_image006 "src=" http://s3.51cto.com/wyfs02/M02/70/03/ Wkiol1wvgozdum72aafifodeanm595.jpg "width=" 604 "height=" 340 "/>

Configuring SELinux

Enter sudo vim/etc/selinux/config in the terminal to change to the following information

650) this.width=650; "title=" clip_image008 "style=" border-left-0px; border-right-width:0px; Background-image:none; border-bottom-width:0px; padding-top:0px; padding-left:0px; padding-right:0px; border-top-width:0px "border=" 0 "alt=" clip_image008 "src=" http://s3.51cto.com/wyfs02/M00/70/03/ Wkiol1wvgo2qsj2saadoyzewliy005.jpg "width=" 604 "height=" 341 "/>

After the installation is complete, the data storage directory is/var/lib/mongo, and the log storage directory is/var/log/mongodb

Start MongoDB

sudo service Mongod start

650) this.width=650; "title=" clip_image010 "style=" border-left-0px; border-right-width:0px; Background-image:none; border-bottom-width:0px; padding-top:0px; padding-left:0px; padding-right:0px; border-top-width:0px "border=" 0 "alt=" clip_image010 "src=" http://s3.51cto.com/wyfs02/M02/70/06/ Wkiom1wvfwqxcs-daafxal3xobi048.jpg "width=" 604 "height=" 385 "/>

Stop MongoDB

sudo service Mongod stop

650) this.width=650; "title=" clip_image012 "style=" border-left-0px; border-right-width:0px; Background-image:none; border-bottom-width:0px; padding-top:0px; padding-left:0px; padding-right:0px; border-top-width:0px "border=" 0 "alt=" clip_image012 "src=" http://s3.51cto.com/wyfs02/M01/70/06/ Wkiom1wvfwvd1e34aahbltbqpgy695.jpg "width=" 604 "height=" 442 "/>

Restart MongoDB

sudo service mongod restart

650) this.width=650; "title=" clip_image014 "style=" border-left-0px; border-right-width:0px; Background-image:none; border-bottom-width:0px; padding-top:0px; padding-left:0px; padding-right:0px; border-top-width:0px "border=" 0 "alt=" clip_image014 "src=" http://s3.51cto.com/wyfs02/M00/70/03/ Wkiol1wvgpcj0zcqaahbli4nt9u373.jpg "width=" 604 "height=" 444 "/>

Set boot up sudo chkconfig mongod on

650) this.width=650; "title=" clip_image016 "style=" border-left-0px; border-right-width:0px; Background-image:none; border-bottom-width:0px; padding-top:0px; padding-left:0px; padding-right:0px; border-top-width:0px "border=" 0 "alt=" clip_image016 "src=" http://s3.51cto.com/wyfs02/M00/70/03/ Wkiol1wvgpgzhcceaajqlfpdv48336.jpg "width=" 604 "height=" 491 "/>

Verify that MongoDB is starting normally

Viewing information with command Vim/var/log/mongodb/mongod.log

In Terminal input MONGO

650) this.width=650; "title=" clip_image018 "style=" border-left-0px; border-right-width:0px; Background-image:none; border-bottom-width:0px; padding-top:0px; padding-left:0px; padding-right:0px; border-top-width:0px "border=" 0 "alt=" clip_image018 "src=" http://s3.51cto.com/wyfs02/M00/70/06/ Wkiom1wvfw2r-cfwaaeoxresaea004.jpg "width=" 604 "height=" 267 "/>

Uninstalling MongoDB

sudo yum erase $ (rpm-qa | grep mongodb-org)

removing data files

sudo rm-r/var/log/mongodb

sudo rm-r/var/lib/mongo

Centso installation mongodb3.0

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.