【MongoDB】Installation of MongoDB,mongodb

來源:互聯網
上載者:User

【MongoDB】Installation of MongoDB,mongodb

First what I wanna make clear is that in the official website the detailed process of installation has been described. you could call it throught the link 

http://docs.mongodb.org/manual/tutorial/install-mongodb-on-windows/

in the front of the page, one question should be taken into consideration. as the following describes,


and just now I have installed the hotfix to resolve an issue with memory mapped files on windows.

according to the tip in the mongodb manual, the command "wmic os get osarchitecture" could find which version of windos you are running.  So supprising. 

because I download the zip version of software, in the software package, it contains the following content. 



and then in the d:program( I always install the devlopment software in the d:program). it depends on you. 


Now let's start the server. 



from the last sentence, we could know infomation that the server run successfully, and default port is 27017. 

use mongo command we could find the version installed , and then test success.




Exception what may happened. 


see http://blog.mongodb.org/post/137788967/32-bit-limitations





【MongoDB】怎停止MongoDB伺服器

如果伺服器是作為前台進程運行在終端的,就直接按Ctrl-C。否則,就用kill這種命令發出訊號。如果mongod的PID是10014,就可以用kill -2 10014(SIGINT)或者kill 10014(SIGTERM)。
當mongod收到SIGINT或者SIGTERM時,會穩妥退出。也就是說會等到當前啟動並執行操作或檔案預分配完成(需要一些時間),關閉所有開啟的串連,將緩衝的資料重新整理到磁碟,最後停止。 千萬不要向運行中的MongoDB發送SIGKILL(kill -9)。這樣會導致資料庫直接關閉,上面降到的步驟都將被忽略,這會使資料檔案損毀。
 
MongoDB安裝後出現錯誤 ,怎解決

安裝?MongoDB的安裝你是指的什嗎?
一般來說windows下的MongoDB只需要將官網上的檔案解壓出來即可,你需要做的是啟動MongoDB服務。MongoDB的服務指的是mongod進程,也就是bin目錄下的mongod.exe的啟動。然後你可以利用MongoDB內建的用戶端shell,即bin目錄下的mongo.exe訪問這一服務。
綜上,我認為可能的原因:
1、肯定是這個啦,你沒有啟動MongoDB服務,用bin/mongod啟動即可
2、是不是改變了預設連接埠,預設情況下MongoDB用的是27017,你如果改變了這一啟動配置,如採用bin/mongod -por 27000,那麼你就得用bin/mongo -port 27000來串連。
3、啟動時mongod報錯了,這個你得把日誌發出來才能處理。
 

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.