MongoDB Linux 安裝配置 後台運行

來源:互聯網
上載者:User

標籤:http   io   os   ar   for   sp   檔案   div   on   

介紹安裝的文檔很多,可以參考這篇:

http://www.mkyong.com/mongodb/how-to-install-mongodb-on-mac-os-x/

安裝完後你可能會碰到的2個問題。

1.讓mongod在後台運行啟動mongo的命令mongod有一個參數--fork可以使mongo在後台運行,但同時必須設定--logpath參數指定開機記錄檔案的路徑,因為此時日誌無法寫到控制台了。例子:
mongod --fork --logpath /var/log/mongod.log
The MongoDB daemon (mongod) has a command-line option to run the server in the background...
--fork
This command-line option requires that you also specify a file to log messages to (since it can not use the current console). An example of this command looks like:
mongod --fork --logpath /var/log/mongod.log
You could put this into an /etc/init.d/mongod bash script file. And then to have the service run at startup, create the standard symbolic links (S## & K##) inside of /etc/rc#.d/. Here is a tutorial that explains this process in more detail. Scroll down to the section titled "Init Script Activation". This also has the added benefit of being able to execute commands like...
service mongod statusservice mongod startservice mongos stop

2.執行mongod —fork —logpath /var/log/mongod.log 出錯

about to fork child process, waiting until server is ready for connections. forked process: 10293 child process started successfully, parent exiting

這是因為目前使用者對日誌目錄/var/log的許可權不足

MongoDB Linux 安裝配置 後台運行

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.