MongoDB is a product between a relational database and a non-relational database, and is the most versatile and most like relational database in a non-relational database. The data structure he supports is very loose and is a JSON-like Bson format, so you can store more complex data types. MONGO's biggest feature is that the query language he supports is very powerful, and its syntax is a bit like an object-oriented query language that almost implements most of the functionality of a relational database single-table query, and also supports indexing of data.
The following describes the installation and configuration of MongoDB
1.
Download
: Http://www.mongodb.org/downloads
2.
installation
Unzip, rename folder to MongoDB, move to/usr/local/
Create a new data/db directory in the MongoDB directory to hold the data, a logs directory to store the log
/usr/local/mongodb/data/db
/usr/local/mongodb/logs
3.
Setting up boot-up, adding environment variables
Adding MongoDB to rc.local let MongoDB start when the server is powered on
sudo echo "/usr/local/mongodb/bin/mongod--dbpath=/usr/local/mongodb/data/db–logpath=/usr/local/mongodb/logs– Logappend--auth–port=27017 ">>/etc/rc.local
By adding/usr/local/mongodb/bin to the environment variable, you can use the MONGO command in the terminal.
4.
Start MongoDB
No environment variables added:
CD to the Bin folder under the MongoDB directory./mongod
To add an environment variable:
Use the Mongod command directly
Configuring MongoDB with configuration files
Create a new file in the MongoDB directory, mongodb.conf
Open mongodb.conf, add configuration information
port=27018
dbpath=data/db
Logpath=log
Logappend=true
Starting MongoDB via Mongod-f mongodb.conf,port defaults to 27017
You can also write a shell script for easy startup
The installation and configuration of MongoDB under Linux