由於某些原因,在我所在的地區,我無法通過終端從apt-get
下載並安裝mongodb。所以我下載了.tar.gz
版本http://docs.mongodb.org/manual/tutorial/install-mongodb-on-linux/如何在Ubuntu中運行mongodb(從tar.gz中提取)作爲服務?
我可以開始它的mongod
程序。但我想安裝mongod作爲在Ubuntu 14.04啓動時運行的服務。如何正確執行此操作? 我試過了一些由此提供的init.d腳本:https://ewan.im/15/mongodb-initd-script
唯一的問題是:在14.04,他們刪除了chkconfig
。我的實驗安裝的chkconfig結束了
Package chkconfig is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'chkconfig' has no installation candidate
編輯:我試過https://askubuntu.com/questions/221293/why-is-chkconfig-no-longer-available-in-ubuntu沒有運氣無論是。
我希望我應該使用upstart
或systemd
。任何人都可以有例子或其他解決方案嗎?
你試試這個替代chkconfig的http://askubuntu.com/questions/221293/why-is-chkconfig-no-longer-available-in-ubuntu –
沒了,已經試過這樣:sudo的SYSV-RC - conf mongod上,仍然在連接錯誤,但如果我直接執行我的mongod,它運行! – DennyHiu
我不能幫助啓動mongodb作爲一項服務它取決於你的個人配置,但我可以做一個init.d腳本來啓動和關閉你的mongod在特定的運行級別如果你想 –