轉: How to Install MongoDB 3.2 on CentOS/RHEL & Fedora (簡單易懂)

來源:互聯網
上載者:User

標籤:

from:  http://tecadmin.net/install-mongodb-on-centos-rhel-and-fedora/

 

MongoDB (named from “huMONGOus“) is a full flexible index support and rich queries database. Its is a NoSQL database. MongoDB provides large media storage with GridFS. Clickhere for more details about mongoDB.

MongoDB has released new stable version 3.2 with lots of major enhancements. This tutorial will help you to install MongoDB 3.2.X on CentOS, RHEL and Fedora Systems.

Step 1 – Add MongoDB Yum Repository

Add following content in yum repository configuration file /etc/yum.repos.d/mongodb.repo as per your required MongoDB version and system architecture. For this article we are using MongoDB 3.2 repository.

For 64bit Systems:

[MongoDB]name=MongoDB Repositorybaseurl=http://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.2/x86_64/gpgcheck=0enabled=1
Step 2 – Install MongoDB Server

Lets use yum package manager to install mongodb-org package, it will automatically install all its dependencies. To install any specific revision of mongodb specify package name with version like mongodb-org-3.2.0. Following command will install latest stable version available.

# yum install mongodb-org
Step 3 – Start MongoDB

Package mongodb-org-server provided MongoDB init script, Use that script to start service.

# /etc/init.d/mongod restart

Configure MongoDB to auto start on system boot.

# chkconfig mongod on
Step 4 – Check MongoDB Version

Use following command to check installed mongodb version

[[email protected] ~]#  mongod --versiondb version v3.2.0git version: 45d947729a0315accb6d4f15a6b06be6d9c19fe7OpenSSL version: OpenSSL 1.0.1e-fips 11 Feb 2013allocator: tcmallocmodules: nonebuild environment:    distmod: rhel70    distarch: x86_64    target_arch: x86_64

Connect MongoDB using command line and execute some test commands for checking proper working.

[[email protected] ~]#  mongo> use mydb;> db.test.save( { a: 1 } )> db.test.find()  { "_id" : ObjectId("54fc2a4c71b56443ced99ba2"), "a" : 1 }

Congratulation’s You have successfully installed mongodb server on your system. For practice only you may use MongoDB browser shell.

References:
http://docs.mongodb.org/manual/installation/

轉: How to Install MongoDB 3.2 on CentOS/RHEL & Fedora (簡單易懂)

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.