Install mongodb and mongodb
Install
1> set the mongoDB directory
[Root @ vm13 home] # cd/home/apps
Appendix: [root @ vm13 home] # mkdir-p/home/apps
2> upload the mongodb-linux-x86_64-2.4.11.tar file to the/home/apps directory.
3> decompress the file
[Root @ vm13 apps] # tar xzf mongodb-linux-x86_64-2.4.11.tar
Folder rename
[Root @ vm13 apps] # Music mongodb-linux-x86_64-2.4.11 mongodb
4> create directories and files
[Root @ vm13 apps] # mkdir-p mongodb/data/db
[Root @ vm13 apps] # mkdir-p mongodb/logs
[Root @ vm13 apps] # touch mongodb/logs/mongodb. logs
5> start the service
[Root @ vm13 apps] #. /mongodb/bin/mongod-dbpath =/home/apps/mongodb/data/db-logpath =/home/apps/mongodb/logs/mongodb. logs
All output going to:/home/apps/mongodb/logs/mongodb. logs
6> Add the mongoDB service to the random start
[Root @ vm13 apps] # vi/etc/rc. local
Use the vi editor to open the configuration file and add the following line of code
[Root @ vm13 apps] #/home/apps/mongodb/bin/mongod -- dbpath/home/apps/mongodb/data/db -- port 27017 -- logpath/home/apps/mongodb /logs/mongodb. logs -- logappend