homebrew安裝mongodb報(bào)錯

今天在使用brew install mongodb 安裝 mongodb 時,報(bào)Error: No available formula with the name 'mongodb'

經(jīng)原因查找如下:


圖一
設(shè)定:
$ brew tap mongodb/brew

安裝公式:
$ brew install mongodb-community

mongodb-community公式的默認(rèn)路徑:
配置文件: /usr/local/etc/mongod.conf
日志目錄路徑: /usr/local/var/log/mongodb
數(shù)據(jù)目錄路徑: /usr/local/var/mongodb

mongod作為服務(wù)運(yùn)行:

啟動mongodb-community服務(wù)器:$ brew services start mongodb-community
關(guān)閉mongodb-community服務(wù)器:$ brew services stop mongodb-community

mongod手動開始:

如果您不需要或不需要后臺MongoDB服務(wù),則可以運(yùn)行:
$ mongod --config /usr/local/etc/mongod.conf
注意:如果您未在--config配置文件路徑中包含該選項(xiàng),則MongoDB服務(wù)器將沒有默認(rèn)配置文件或日志目錄路徑,而將使用的數(shù)據(jù)目錄路徑/data/db。

要mongod手動啟動關(guān)機(jī),請使用admin數(shù)據(jù)庫并運(yùn)行db.shutdownServer():
$ mongo admin --eval "db.shutdownServer()"

參考鏈接:https://segmentfault.com/a/1190000020400235?utm_source=tag-newest
git鏈接:https://github.com/mongodb/homebrew-brew

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容