Yum Source Installation MongoDB

Source: Internet
Author: User
Tags install mongodb mongo shell

Yum Source Installation MongoDB

MongoDB v2.6.0 version of the software warehouse a total of five packages:
1) mongodb-org
This package is a metadata package that can be implemented to automatically install the following 4 component packages.
2) Mongodb-org-server
This package contains the Mongod daemon, along with the associated configuration and initialization scripts.
3) Mongodb-org-mongos
There is a MONGOs daemon in this package.
4) Mongodb-org-shell
This package has a MONGO shell environment.
5) Mongodb-org-tools
This package contains the following MongoDB tools: Mongoimport, Bsondump, Mongodump, Mongoexport, Mongofiles, Mongoimport, Mongooplog, Mongoperf, Mongorestore, Mongostat and Mongotop.

1. Create a Mongodb.repo file
Create the file Mongodb.repo in the/etc/yum.repos.d/directory, which contains the configuration information for the MongoDB repository, as follows:
[MongoDB]
Name=mongodb Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64/
Gpgcheck=0
Enabled=1

2. Execute the installation command
# yum-y Install mongodb-org
Loaded Plugins:fastestmirror, security
Loading mirror speeds from cached hostfile
* base:mirrors.yun-idc.com
* epel:mirrors.yun-idc.com
* extras:mirrors.yun-idc.com
* updates:mirrors.yun-idc.com
Setting up Install Process
Package mongodb-org-2.6.3-1.x86_64 already installed and latest version
Nothing to do
# Rpm-qa |grep MongoDB
Mongodb-org-2.6.3-1.x86_64
Mongodb-org-mongos-2.6.3-1.x86_64
Mongodb-org-shell-2.6.3-1.x86_64
Mongodb-org-server-2.6.3-1.x86_64
Mongodb-org-tools-2.6.3-1.x86_64

3, custom DB and log storage paths
New Storage DB Directory
#mkdir-P/data/mongodb/log
Set up the owner and owner group and create a new account MongoDB after installing MongoDB
#chown-R Mongod:mongod/data/mongodb
#egrep ' Dbpath|logpath '/etc/mongod.conf
Logpath=/data/mongodb/log/mongod.log
Dbpath=/data/mongodb
The general configuration file is as follows:
# Grep-ev ' ^#|^$ '/etc/mongod.conf
Logpath=/data/mongodb/log/mongod.log
Logappend=true
Fork=true
Dbpath=/data/mongodb
Pidfilepath=/var/run/mongodb/mongod.pid
bind_ip=127.0.0.1
Start Mongod
# Service Mongod Restart
stopping mongod: [OK]
Starting Mongod: [OK]
View Files
# ls/data/mongodb/
Journal local.0 Local.ns Mongod.lock _tmp
To see if the port is open
# SS-ANP |grep Mongod
LISTEN 0 127.0.0.1:27017 *:* Users: (("Mongod", 9295,9))


4, set boot automatically start MongoDB
#chkconfig Mongod on

This article is from the "jerrymin" blog, make sure to keep this source http://jerrymin.blog.51cto.com/3002256/1439097

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.