MongoDB installation under Redhat

Source: Internet
Author: User
Tags mkdir mongodb mongodb download mongodb driver

MongoDB under Redhat installation mongodb download install
  1. : http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.6.10.tgz
  2. The root user performs the following actions in turn
    TAR-ZXVF mongodb-linux-x86_64-2.6.10.tgz
    MV Mongodb-linux-x86_64-2.6.10/usr/local/mongodb
    Cd/usr/local/mongodb
    mkdir DB
    mkdir logs
    CD bin
  3. Add configuration file
    VI mongodb.conf

    dbpath=/usr/local/mongodb/db
    Logpath=/usr/local/mongodb/logs/mongodb.log
    port=27107
    Fork=true
    Nohttpinterface=true

  4. Boot auto Start MongoDB
    Vi/etc/rc.d/rc.local

    /usr/local/mongodb/bin/mongod--config/usr/local/mongodb/bin/mongodb.conf
    Ln-s/usr/local/mongdb/bin/mongo/usr/local/bin/mongo

    Download source for C + + drivers

    : http://github.com/mongodb/mongo-cxx-driver/tree/legacy

    C + + Driver Library installation steps:
    1. Installing the Boost library
    2. Installing the PCRE Ku Zheng expression Library
    3. SCons compiling mongodb driver directive sconstruct This file is the key to compiling
    4. Compile driver Get header file + library file

      Installing the Boost library

      File address: D:\Study\ database \ installation package \mongodb
      File name: Boost_1_66_0
      Go to Folder:cd boost_1_66_0
      Run in sequence:

    ./bootstrap.sh
    ./b2
    ./sudo./B2 Install

    Installing the PCRE Library

    File location: D:\Study\ database \ installation package \mongodb
    File name: pcre-8.00.tar.gz
    Upload to Redhat
    Execute in turn:

    TAR-ZXVF pcre-8.00.tar.gz
    CD pcre-8.00.tar.gz
    ./configure
    Make
    Make install

    Installing SCons compiling MongoDB-driven instructions

    File location: D:\Study\ database \ installation package \mongodb
    File name: scons-2.5.0-1.noarch.rpm
    Upload to Redhat
    Perform:

    RPM-IVH scons-2.5.0-1.noarch.rpm

Install the build driver

File location: D:\Study\ database \ installation package \mongodb
File name: mongodb-linux-x86_64-v2.2-latest.tgz
Execute in turn:

tar -zxvf mongodb-linux-x86_64-v2.2-latest.tgzcd mongo-cxx-driver-v2.2vi src/mongo/pch.h 修改:#define BOOST_FILESYSTEM_VERSION 3sudo scons --extrapath=/usr/local install  
Get file Deployment

Enter Usr/local Integration file:

[[email protected] local]$ ls boost
Include Lib
[[email protected] local]$ ls MONGO
Include Lib

Switch to root user execution:

vi /etc/ld.so.conf添加:上面文件的路径/usr/local/boost/lib/usr/local/mongo/lib保存ldconfig

MongoDB installation under Redhat

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.