Install and configure the MongoDB database under CentOS6.5 _ X64

Source: Internet
Author: User
Tags install mongodb
Linux: CentOS6.5 _ X64IP address: 192.168.1.12 objective: to install and configure a MongoDB Database: 1. Disable SElinux, configure firewall, and vi

Linux: CentOS6.5 _ X64IP address: 192.168.1.12 objective: to install and configure a MongoDB Database: 1. Disable SElinux, configure firewall, and vi/

Linux: CentOS6.5 _ X64
IP Address: 192.168.1.12

Purpose:
Install and configure the MongoDB Database
Specific operations:
1. Disable SElinux and Configure Firewall
1. vi/etc/selinux/config
# SELINUX = enforcing # comment out
# SELINUXTYPE = targeted # comment out
SELINUX = disabled # Add
: Wq! # Save and exit
Setenforce 0 # Make the configuration take effect immediately


2. vi/etc/sysconfig/iptables # Edit
-A RH-Firewall-1-INPUT-m state -- state NEW-m tcp-p tcp -- dport 27017-j ACCEPT # Allow port 27017 through the firewall
: Wq! # Save and exit
/Etc/init. d/iptables restart # restart the firewall to make the configuration take effect.

Ii. Install MongoDB
1. Download MongoDB
First you need to register an account on the https://www.mongodb.org/downloads, and then download
MongoDB: https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.7.0.tgz to/usr/local/src directory
# The latest upload https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.7.0.tgz
Tar zxvf mongodb-linux-x86_64-2.7.0.tgz # Extract
Mv mongodb-linux-x86_64-2.7.0/usr/local/mongodb # Move the decompressed folder to the MongoDB installation directory
Mkdir-p/data/mongodb/mongodb_data/# create a MongoDB database storage path
Mkdir-p/data/mongodb/mongodb_log/# create a MongoDB database log storage path
# Start MongoDB
/Usr/local/mongodb/bin/mongod -- port 27017 -- fork -- dbpath =/data/mongodb/mongodb_data/-- logpath =/data/mongodb/mongodb_log/mongodb. log -- logappend


About to fork child process, waiting until server is ready for connections.
Forked process: 1998
Child process started successfully, parent exiting


Netstat-ntpl # Check whether MongoDB is started



Cd/usr/local/mongodb/bin/
./Mongo # enter the MongoDB Database Console
Use admin # enter the admin Database
Db. shutdownServer () # Shut down the MongoDB Database
Exit # exit

CentOS compilation and installation of MongoDB

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

3. Set up a MongoDB Database
1. cd/usr/local/mongodb/# enter the MongoDB installation directory
Vi/usr/local/mongodb. conf # Edit
Port = 27017 # port number
Dbpath =/data/mongodb/mongodb_data/# Database path
Logpath =/data/mongodb/mongodb_log/mongodb. log # log output file path
Pidfilepath =/usr/local/mongodb/mongo. pid
Fork = true # Set the background to run
Logappend = true # log output mode
Shardsvr = true
Directoryperdb = true
# Auth = true # enable authentication
: Wq! # Save and exit

For more details, please continue to read the highlights on the next page:

,

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.