隨筆-11  評論-0  文章-2  trackbacks-0

          1)、下載MongoDB
          http://downloads.mongodb.org/win32/mongodb-win32-i386-2.0.4.zip

          2)、設置MongoDB目錄

          將其解壓到 d:\,再重命名為mongodb,路徑為d:\mongodb

          3)、設置數據文件路徑

          d:盤建一個data文件夾,在data文件夾中新建db文件夾,路徑d:\data\db

          4)、啟動MongoDB服務

          進入 cmd 提示符控制臺,
          D:\mongodb\bin\mongod.exe --dbpath=d:\data\db

          <!--[if !supportLists]-->1.  <!--[endif]-->Mon Apr 16 08:50:54
          <!--[if !supportLists]-->2.  <!--[endif]-->Mon Apr 16 08:50:54 warning: 32-bit servers don't have journaling enabled by def
          <!--[if !supportLists]-->3.  <!--[endif]-->ault. Please use --journal if you want durability.
          <!--[if !supportLists]-->4.  <!--[endif]-->Mon Apr 16 08:50:54
          <!--[if !supportLists]-->5.  <!--[endif]-->Mon Apr 16 08:50:54 [initandlisten] MongoDB starting : pid=5084 port=27017 dbpat
          <!--[if !supportLists]-->6.  <!--[endif]-->h=d:\data\db 32-bit host=PC-201012302214
          <!--[if !supportLists]-->7.  <!--[endif]-->Mon Apr 16 08:50:54 [initandlisten]
          <!--[if !supportLists]-->8.  <!--[endif]-->Mon Apr 16 08:50:54 [initandlisten] ** NOTE: when using MongoDB 32 bit, you are
          <!--[if !supportLists]-->9.  <!--[endif]-->limited to about 2 gigabytes of data
          <!--[if !supportLists]-->10. <!--[endif]-->Mon Apr 16 08:50:54 [initandlisten] **       see http://blog.mongodb.org/post/13
          <!--[if !supportLists]-->11. <!--[endif]-->7788967/32-bit-limitations
          <!--[if !supportLists]-->12. <!--[endif]-->Mon Apr 16 08:50:54 [initandlisten] **       with --journal, the limit is lower
          <!--[if !supportLists]-->13. <!--[endif]-->Mon Apr 16 08:50:54 [initandlisten]
          <!--[if !supportLists]-->14. <!--[endif]-->Mon Apr 16 08:50:54 [initandlisten] db version v2.0.4, pdfile version 4.5
          <!--[if !supportLists]-->15. <!--[endif]-->Mon Apr 16 08:50:54 [initandlisten] git version: 329f3c47fe8136c03392c8f0e548506
          <!--[if !supportLists]-->16. <!--[endif]-->cb21f8ebf
          <!--[if !supportLists]-->17. <!--[endif]-->Mon Apr 16 08:50:54 [initandlisten] build info: windows sys.getwindowsversion(ma
          <!--[if !supportLists]-->18. <!--[endif]-->jor=6, minor=0, build=6002, platform=2, service_pack='Service Pack 2') BOOST_LIB
          <!--[if !supportLists]-->19. <!--[endif]-->_VERSION=1_42
          <!--[if !supportLists]-->20. <!--[endif]-->Mon Apr 16 08:50:54 [initandlisten] options: { dbpath: "d:\data\db" }
          <!--[if !supportLists]-->21. <!--[endif]-->Mon Apr 16 08:50:54 [websvr] admin web console waiting for connections on port 2
          <!--[if !supportLists]-->22. <!--[endif]-->8017
          <!--[if !supportLists]-->23. <!--[endif]-->Mon Apr 16 08:50:54 [initandlisten] waiting for connections on port 27017

          MongoDB服務端的默認連接端口:27017

          5)、將MongoDB作為 Windows 服務隨機啟動

          先創建D:\mongodb\logs\mongodb.log文件,用于存儲MongoDB的日志文件, 再安裝系統服務:
                
          D:\mongodb\bin\mongod --dbpath=d:\data\db --logpath=d:\mongodb\log

          s\mongodb.log --install   
          all output going to: d:\mongodb\logs\mongodb.log  
          Creating service MongoDB.  
          Service creation successful.  
          Service can be started from the command line via 'net start "MongoDB"'.
          D:\>net start mongodb  
          Mongo DB 
          服務已經啟動成功。  
          D:> 
          注意:如果需要卸載服務,執行命令:sc delete MongoDB

          6)、客戶端連接驗證

          新打開一個CMD輸入:d:\mongodb\bin\mongo,如果出現下面提示,那么您就可以開始MongoDB之旅了:

          <!--[if !supportLists]-->1.  <!--[endif]-->d:\mongodb\bin\mongo  
          <!--[if !supportLists]-->2.  <!--[endif]-->MongoDB shell version: 2.0.4  
          <!--[if !supportLists]-->3.  <!--[endif]-->connecting to: test  
          <!--[if !supportLists]-->4.  <!--[endif]-->> 

          7)、查看MongoDB日志

          查看D:\mongodb\logs\mongodb.log文件,即可對MongoDB的運行情況進行查看或排錯。

          posted on 2012-07-10 13:24 閱讀(639) 評論(0)  編輯  收藏 所屬分類: JAVA

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 保德县| 洪雅县| 晋中市| 长宁县| 兴业县| 彰化县| 体育| 长寿区| 高邑县| 山阴县| 沾化县| 勐海县| 黄龙县| 荃湾区| 白河县| 盐源县| 博爱县| 泗阳县| 射洪县| 石嘴山市| 秀山| 白玉县| 集贤县| 新巴尔虎右旗| 乐至县| 晋江市| 海原县| 和平县| 开鲁县| 都匀市| 车致| 枣庄市| 雷州市| 长阳| 交口县| 抚州市| 万载县| 海阳市| 漳浦县| 菏泽市| 偃师市|