zoukankan      html  css  js  c++  java
  • 转: How to Install MongoDB 3.2 on CentOS/RHEL & Fedora (简单易懂)

    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.

    install 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 Repository
    baseurl=http://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.2/x86_64/
    gpgcheck=0
    enabled=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

    [root@tecadmin ~]#  mongod --version
    
    db version v3.2.0
    git version: 45d947729a0315accb6d4f15a6b06be6d9c19fe7
    OpenSSL version: OpenSSL 1.0.1e-fips 11 Feb 2013
    allocator: tcmalloc
    modules: none
    build environment:
        distmod: rhel70
        distarch: x86_64
        target_arch: x86_64
    

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

    [root@tecadmin ~]#  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/

  • 相关阅读:
    案例5-1.3 整型关键字的散列映射 (25分)--散列表(除留余数法+线性探测法)
    基础实验5-2.2 电话聊天狂人 (25分)-散列表
    习题8.4 畅通工程之最低成本建设问题 (30分)--最小生成树
    练习4.2 平衡二叉树的根 (25分)
    案例7-1.5 与零交换 (25分)--dfs
    习题2.8 输出全排列 (20分)--dfs
    nginx 日志切割
    mysql添加索引
    mysql常见错误码及说明
    MYSQL数据类型分类
  • 原文地址:https://www.cnblogs.com/jhj117/p/5729132.html
Copyright © 2011-2022 走看看