錯誤:啟動 mongodb 時單元 mongodb.service 被屏蔽

錯誤:啟動 mongodb 時單元 mongodb.service 被屏蔽

我試圖在安裝依賴項時安裝 kaa(IOT 平台),但在執行命令時出現錯誤-

$ sudo systemctl start mongodb
error- Failed to start mongodb.service: Unit mongodb.service is masked.

答案1

單元 mongodb.service 被屏蔽。

所以揭開它的面具:

sudo systemctl unmask mongodb

為什麼某些 systemd 服務處於「屏蔽」狀態? 解釋了掩蔽。

答案2

使用 3+ 版本的 mongodb。您不必啟動,mongodb但只需啟動 mongod 即可。所以啟動 mongod 的正確方法是

sudo systemctl start mongod

相關內容