Install MongoDB 3.0.2 in 64-bit CentOS 6.2

Source: Internet
Author: User
Tags install mongodb

Install MongoDB 3.0.2 in 64-bit CentOS 6.2

Mongo is easy to manage using yum, as long as you create/etc/yum. repos. d/mongodb-org-3.0.repo, write:

Mongodb-org-3.0
Name = MongoDB Repository
Baseurl = http://repo.mongodb.org/yum/redhat/?releasever/mongodb-org/3.0/x86_64/
Gpgcheck = 0
Enabled = 1

Then

Sudo yum install-y mongodb-org

You can.

However, the download speed may be too slow. If you do not use yum:

1. Download MongoDB
MongoDB does not have a compressed package specially developed for CentOS, but it has a Red Hat package of RHDL and a linux-legacy package. However, linux-legcy does not integrate openssl, therefore, it cannot be used in a secure production environment. Centos seems to be able to use the RHDL package (no problem currently ),

: Http://www.mongodb.org/downloads or directly:

Wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel62-3.0.2.tgz

2. Install Dependencies

Decompress tar zxf mongodb-linux-x86_64-rhel62-3.0.2.tgz to run bin/mongod,

/Usr/mongodb/bin/mongod:/usr/lib64/libssl. so.10: no version information available (required by/usr/mongodb/bin/mongod)

This is the issue of openssl package dependency.

Sudo yum update openssl is convenient and quick to update openssl ~

You can also download the latest version in the https://www.openssl.org/source:

Wget https://www.openssl.org/source/openssl-1.0.2a.tar.gz

Installation, But it seems quite troublesome. I installed it for 2 hours to solve the dependency problem, and finally showed that the main program is correct, but mongod still reported a missing package error.

3. Run
Run bin/mongod in the main directory of MongoDB to display that port 27017 is listening

Run a new ssh command to execute bin/mongo and log on successfully.

4. Configuration
By default, mongod can only log on locally and use/data/db as the database data storage directory. to modify these configurations, you can use the configuration file
Mongod can use mongod -- config configfile or mongod-f configfile at runtime to specify to start the process using the config file configfile, the detailed config can be in the http://docs.mongodb.org/v2.4/reference/configuration-options:

Logpath =/var/log/mongodb/mongod. log # directory of the log file
Logappend = true # whether to continue writing under the same Log File
Fork = true # whether to create a background daemon
Port = 27017 # Listening to the client port
Pidfilepath =/var/run/mongodb/mongod. pid # The file that stores the pid of the mongod Process
Bind_ip = 192.168.12.179 # access restriction. Only this address can be accessed by a client. If you want to access it from another machine, comment out

In addition, several configurations are required to build a replica Set cluster:

ReplSet = clover # replica Set Name
OplogSize = 1024 # size of the Operation Log File

For more MongoDB tutorials, see the following:

CentOS compilation and installation of php extensions for MongoDB and mongoDB

CentOS 6 install MongoDB and server configuration using yum

Install MongoDB2.4.3 in Ubuntu 13.04

MongoDB beginners must read (both concepts and practices)

MongoDB Installation Guide for Ubunu 14.04

MongoDB authoritative Guide (The Definitive Guide) in English [PDF]

Nagios monitoring MongoDB sharded cluster service practice

Build MongoDB Service Based on CentOS 6.5 Operating System

MongoDB details: click here
MongoDB: click here

This article permanently updates the link address:

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.