Advertisement
shokti

centos 6.5 - mongodb

May 6th, 2014
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. add mongodb repo:
  2. nano /etc/yum.repos.d/mongodb.repo
  3. --------------------------------------
  4. for 32bit
  5. --------------------------------------
  6. [mongodb]
  7. name=MongoDB Repository
  8. baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/i686/
  9. gpgcheck=0
  10. enabled=1
  11. --------------------------------------
  12.  
  13. --------------------------------------
  14. for 64bit
  15. --------------------------------------
  16. [mongodb]
  17. name=MongoDB Repository
  18. baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64/
  19. gpgcheck=0
  20. enabled=1
  21. --------------------------------------
  22.  
  23. install mongodb from repo:
  24. yum install mongodb-org
  25.  
  26. start mongodb on boot:
  27. chkconfig mongod on
  28.  
  29. start mongodb:
  30. service mongod start
  31.  
  32. display version:
  33. mongo --version
  34.  
  35. run mongodb prompt:
  36. mongo
  37.  
  38. (test sample output)
  39. --------------------------------------
  40. > db.test.save( { a: 1 } )
  41. > db.test.find()
  42.  
  43. { "_id" : ObjectId("52b0dc8285f8a8071cbb5daf"), "a" : 1 }
  44. --------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement