Background knowledge
MongoDB is an open source, NoSQL (not just SQL) document database written in C + +.
Features: High performance (higher performance), high availability (highly reliable), and automatic scaling (auto-tuning).
The structure is similar to JSON.
Installation
1. Download the installation package Www.mongodb.org/downloads
Curl-o http://downloads.mongodb.org/linux/mongodb-linux-x86_64-2.6.3.tgz
2. Unpack the TGZ package
tar -zxvf mongodb-linux-x86_64-2.6. 3. tgz
3. Copy the extracted folder to the specified directory
Note the permissions, if prompted without permission, use sudo, or modify the directory's own.
mkdir -p mongodbcp -r-n mongodb-linux-x86_64-2.6. 3/MongoDB
4. Modify/etc/profile (valid for all users) or ~/.BASHRC (valid for current user), add mongodb/bin to path.
Export mongodb=/opt/mongodbexport PATH= $MONGODB/bin: $PATH
Note: If the operating system is Debian/redhat series, it can be installed through Apt-get/yum.
For more information, please refer to the official documentation: http://docs.mongodb.org/manual/administration/install-on-linux/
Run
5. Create the folder where the database is stored (it is recommended to change the following/data/db to the local storage path)
mkdir -p/data/db
6. Modify and confirm that the folder has read and modify permissions (user changed to your current user's name)
chown user/data/dborchmod777 /data/db
7. Run MongoDB (if you do not specify path, the default is/data/db, it is recommended to specify the pathname)
Mongod--dbpath <path to Data directory>