MongoDB Foreign mirror access is very slow, so that the choice of MongoDB official website online installation is not reliable. Then, we can choose to install the MongoDB 2.6 binary release package.
Below we install the latest MongoDB 2.6.02 CentOS on the 6.5 x64 system.
1. Download MongoDB 2.6.02 In-System release
Copy Code code as follows:
$ Curl-o http://downloads.mongodb.org/linux/mongodb-linux-x86_64-2.6.0.tgz
2, Decompression MongoDB compression package
Copy Code code as follows:
$ tar zvxf mongodb-linux-x86_64-2.6.0.tgz
3. Simplify directory Name
Copy Code code as follows:
$ mv mongodb-linux-x86_64-2.6.0 MongoDB
4. Configure the PATH environment variable
Make sure that the MongoDB Bin directory is contained in the PATH environment variable.
Or the primary symbol is connected to the/usr/local/bin directory.
Copy Code code as follows:
Add the following:
Copy Code code as follows:
Export path= $PATH:/home/chuser/mongodb/bin
Let environment variables take effect:
Copy Code code as follows:
Verify that the environment variable is in effect:
Copy Code code as follows:
$ mongod-version
DB version v2.6.0
2014-04-14t02:53:01.082+0000 git version:1c1c76aeca21c5983dc178920f5052c298db616c
5. Operation MongoDB
Create a Data directory
Copy Code code as follows:
$ mkdir-p mongodb/data/db
Make sure Mongod has read and write access to the data directory.
Run MongoDB (Specify the established data directory)
Copy Code code as follows:
$ Mongod--dbpath/home/chuser/mongodb/data &
6, verify the MongoDB is normal operation
Copy Code code as follows:
$ MONGO
MongoDB Shell version:2.6.0
Connecting To:test
2014-04-14t03:40:59.560+0000 [Initandlisten] connection accepted from 127.0.0.1:39014 #1 (1 connection now OPEN)
Welcome to the MongoDB shell.
For interactive help, type ' help '.
For more comprehensive documentation
http://docs.mongodb.org/
Questions? Try the Support group
Http://groups.google.com/group/mongodb-user
> show databases;
Admin (empty)
Local 0.078GB