Table of Contents
change to root
add yum repo
install mongodb
Configure MongoDB
Start MongoDB Server
Start MongoDB on boot
Test MongoDB Server
Open MongoDB Port (27017) on Iptables Firewall
Restart Iptables Firewall
Test remote connection
nodejs
Home Database Mysql Tutorial centos 下安装 mongodb 小纸条

centos 下安装 mongodb 小纸条

Jun 07, 2016 pm 04:32 PM
centos change mongodb ro Install

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 mongod start ## OR ## /etc/init.d/mongod 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

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

SCP usage tips-recursively exclude files SCP usage tips-recursively exclude files Apr 22, 2024 am 09:04 AM

SCP usage tips-recursively exclude files

The difference between nodejs and vuejs The difference between nodejs and vuejs Apr 21, 2024 am 04:17 AM

The difference between nodejs and vuejs

How to configure gateway in centos How to configure gateway in centos Apr 07, 2024 pm 08:51 PM

How to configure gateway in centos

How to open the linux terminal shortcut key How to open the linux terminal shortcut key Apr 11, 2024 pm 06:33 PM

How to open the linux terminal shortcut key

How to download 360 Secure Browser on your computer How to download 360 Secure Browser on your computer Apr 12, 2024 pm 01:52 PM

How to download 360 Secure Browser on your computer

Nodejs front-end and back-end distinction Nodejs front-end and back-end distinction Apr 21, 2024 am 03:43 AM

Nodejs front-end and back-end distinction

What are the classifications of linux systems? What are the classifications of linux systems? Apr 12, 2024 pm 02:15 PM

What are the classifications of linux systems?

How to type Chinese in centos How to type Chinese in centos Apr 07, 2024 pm 08:24 PM

How to type Chinese in centos

See all articles