Install mongodb on centos

Source: Internet
Author: User
Tags install mongodb mongodb server
Changetorootsu

Change to root su-##or ## sudo-I add yum repo/etc/yum. repos. d/10gen-mongodb.repo [10gen] name = 10gen Repository baseurl = http://downloads-distro.mongodb.org/repo/redhat/ OS /i686 gpgcheck = 0 install mongodb yum install mongo-10gen mongo-10

Change to root

Su-# OR # sudo-I

Add yum repo

/Etc/yum. repos. d/10gen-mongodb.repo [10gen] name = 10gen Repository baseurl = http://downloads-distro.mongodb.org/repo/redhat/ OS /i686 gpgcheck = 0

Install mongodb

Yum install mongo-10gen mongo-10gen-server

Configure MongoDB

Vi/etc/mongod. conf logpath =/var/log/mongo/mongod. log port = 27017 dbpath =/var/lib/mongo

Start MongoDB Server

Service Producer d start ##or ##/etc/init. d/producer d start

Start MongoDB on boot

Chkconfig -- levels 235 mongod on

Test MongoDB Server

Mongo use test switched to db test db. foo. find () db. foo. save ({a: 1}) db. foo. find ()

Open MongoDB Port (27017) on Iptables Firewall

/Etc/sysconfig/iptables-a input-m state -- state NEW-m tcp-p tcp -- dport 27017-j ACCEPT

Restart Iptables Firewall

Service iptables restart ##or ##/etc/init. d/iptables restart

Test remote connection

Mongo server: port/database ## Example # mongo 10.0.10.45: 27017/test

Nodejs

Cd ~ Wget https://raw.github.com/isaacs/nave/master/nave.sh chmod + x nave. sh./nave. sh install 0.10.21./nave. sh use 0.10.21 node-v

Original article address: Install mongodb in centos. Thank you for sharing it with me.

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.