The access to foreign MongoDB images is very slow, so it is very unreliable to select the MongoDB official website for online installation. Then, we can choose to install the binary release package of MongoDB2.6.
The access to foreign MongoDB images is very slow, so it is very unreliable to select the MongoDB official website for online installation. Then, we can choose to install the binary release package of MongoDB 2.6.
The access to foreign MongoDB images is very slow, so it is unreliable to select the MongoDB official website for online installation. Then, we can choose to install the binary release package of MongoDB 2.6.
Related reading:
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 authoritative Guide (The Definitive Guide) in English [PDF]
Next we will install the latest MongoDB 2.6.0 binary release on CentOS 6.5 x64.
1. Download MongoDB 2.6.0 binary release
$ Curl-O
2. decompress the MongoDB compressed package
$ Tar zvxf mongodb-linux-x86_64-2.6.0.tgz
3. Simplified directory name
$ Mv mongodb-linux-x86_64-2.6.0 mongodb
4. Configure the PATH environment variable
Make sure that the bin directory of MongoDB is included in the PATH environment variable.
Or connect the initial symbol to the/usr/local/bin directory.
$ Sudo vi/etc/profile
Add the following content:
Export PATH = $ PATH:/home/chuser/mongodb/bin
Make environment variables take effect:
$ Source/etc/profile
Verify that the environment variables take effect:
$ Mongod-version
Db version v2.6.0
2014-04-14T02: 53: 01.082 + 0000 git version: 1c1c76aeca21c5983dc178920f5052c298db616c
5. Run MongoDB
Create a data directory
$ Mkdir-p mongodb/data/db
Make sure that mongod has the read and write permissions on the data directory.
Run MongoDB (specify the created data directory)
$ Mongod -- dbpath/home/chuser/mongodb/data &
6. Verify that MongoDB is running properly.
$ 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, see
Questions? Try the support group
> Show databases;
Admin (empty)
Local 0.078 GB
MongoDB details: click here
MongoDB: click here