MongoDB is a distributed file storage-based database. Written in C ++. It is designed to provide scalable, high-performance data storage solutions for WEB applications.
MongoDB is a distributed file storage-based database. Written in C ++. It is designed to provide scalable, high-performance data storage solutions for WEB applications.
Introduction
MongoDB is a distributed file storage-based database. Written in C ++. It is designed to provide scalable, high-performance data storage solutions for WEB applications.
Features
High performance, easy to deploy, easy to use, and easy to store data.
Features:
Usage Principle
The so-called "Collenction-Oriented" means that data is stored in a data set by groups and is called a set ). Each set has a unique identification name in the database and can contain an infinite number of documents. The concept of a set is similar to that of a table in a relational database service (RDBMS). The difference is that it does not need to define any schema ).
Schema-free means that we do not need to know any schema definitions for the files stored in the mongodb database. If necessary, you can store files of different structures in the same database.
The document stored in the set is saved as a key-value pair. Key is used to uniquely identify a document, which is a string type, and the value can be a variety of complex file types. We call this storage form BSON (Binary JSON ).
Preparation
1. Download the installation file.
Cd/tmp
Wget https://www.mongodb.org/dr//fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.4.10.tgz/download
Tar-zxvf download
C/tmp/mongodb-linux-x86_64-2.4.10/bin
Cp */usr/bin/
Install
1. Create the startup user mongod.
12 groupadd Development
Useradd-g mongod
Or
Useradd-M-s/sbin/nologin mongod
2. Create a database directory.
# Log file directory
Mkdir-p/data/var/log/mongodb/
# Data file directory
Mkdir-p/data/var/lib/mongodb/
# PID file directory
Mkdir-p/data/var/run/mongodb/
3. Modify the directory owner.
Cd/data/var
Chown-R mongod. mongod log lib run
Configuration
1. Create the configuration file/etc/mongod. conf.
Logpath =/data/var/log/mongodb/mongod. log
Logappend = true
Fork = true
Dbpath =/data/var/lib/mongodb
Journal = true
Directoryperdb = true
Auth = true
# ReplSet = rs_test
# KeyFile =/etc/mongo_main.key
2. If you configure it as a replica integrator, copy the file from another member.
Scp-P 22/etc/mongod. conf [email protected]:/tmp
Scp-P 22/etc/mongo_main.key [email protected]:/tmp
Cp/tmp/cmd_main.key/etc/
Cp/tmp/mongod. conf/etc/
Chown primary D. Primary D/etc/primary _main.key
3. Create the startup script mongod.
Scp-P 22/etc/init. d/mongod [email protected]:/tmp
Cp/tmp/mongod/etc/init. d/mongod
Chkconfig-level 35 mongod on
4. Modify the maximum number of files opened by the system.
Ulimit-n 64000
Vi/etc/security/limits. conf
Add at the end:
* Soft nofile 64000
* Hard nofile 64000
* Soft nproc 32000
* Hard nproc 32000
Vi/etc/profile
Add at the end:
Ulimit-n 64000
Add ulimit-n 64000 in startup script mongod.
5. Start the service.
MongoDB 3.0 official version released and downloaded
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
MongoDB details: click here
MongoDB: click here
This article permanently updates the link address: