Mongodb学習(インストール編):centosでのインストール



  
  
  
  
  1.  
  2.  
  3. ###  
  4. [root@192 lamp]# wget http://fastdl.mongodb.org/linux/mongodb-linux-i686- 
  5.  
  6. 2.2.2.tgz 
  7. ###  
  8. [root@192 lamp]# tar zxvf mongodb-linux-i686-2.2.2.tgz 
  9.  
  10. ###  
  11. [root@192 lamp]# ls 
  12. mongodb-linux-i686-2.2.2  mongodb-linux-i686-2.2.2.tgz 
  13.  
  14. [root@192 lamp]# cd mongodb-linux-i686-2.2.2 
  15. [root@192 mongodb-linux-i686-2.2.2]# ls 
  16. bin  GNU-AGPL-3.0  README  THIRD-PARTY-NOTICES 
  17. [root@192 mongodb-linux-i686-2.2.2]# cd bin/ 
  18. [root@192 bin]# pwd 
  19. /lamp/mongodb-linux-i686-2.2.2/bin 
  20.  
  21. ### /lamp/mongodb-linux-i686-2.2.2/bin /usr/local/mongodb  
  22. [root@192 bin]# cd .. 
  23. [root@192 mongodb-linux-i686-2.2.2]# ls 
  24. bin  GNU-AGPL-3.0  README  THIRD-PARTY-NOTICES 
  25.  
  26. [root@192 mongodb-linux-i686-2.2.2]# rsync -a bin /usr/local/mongodb 
  27.  
  28. ### : 
  29. [root@192 mongodb-linux-i686-2.2.2]cd /usr/local/mongodb 
  30. [root@192 mongodb]# mkdir data 
  31. [root@192 mongodb]# ls 
  32. bin  data 
  33. [root@192 mongodb]# touch dblogs 
  34. [root@192 mongodb]# ls 
  35. bin  data  dblogs 
  36.  
  37. ### ( Daemon ) 
  38. [root@192 mongodb]# cd bin/ 
  39. [root@192 bin]# ./mongod --dbpath=/usr/local/mongodb/data/ -- 
  40.  
  41. logpath=/usr/local/mongodb/dblogs --fork 
  42.  
  43. ### mongod  
  44. [root@192 bin]# pstree -p ¦grep mongod 
  45.  
  46. ### ( ) 
  47. [root@192 bin]# vi /etc/rc.local 
  48.      : 
  49.    /usr/local/mongodb/bin/mongod --dbpath=/usr/local/mongodb/data/ -- 
  50.  
  51. logpath=/ur/local/mongodb/dblogs --fork 
  52.  
  53.  
  54. cat /etc/rc.local 
  55.  
  56. :( ) 
  57. pkill mongod 
  58. killall mongod 
  59.  
  60.  
  61. ps -ef ¦grep mongod 
  62. !ps 
  63.  
  64. mongodb  
  65. [root@192 ~]# cd /urs/local/mongodb/data 
  66. [root@192 data]rm -rf mongod.lock 
転載は明記してください Mongodb学習(インストール編):centosでのインストール