-
首先tap一个仓库
brew tap mongodb/brew
- 安装社区版,4.2 版本
brew install mongodb-community@4.2
- 启动
brew services start mongodb-community
- 验证
ps aux | grep -v grep | grep mongod
- 关闭
brew services stop mongodb-community
- 相关目录
安装目录:/usr/local/opt/mongodb-community
配置文件:/usr/local/etc/mongod.conf
日志目录路径:/usr/local/var/log/mongodb
数据目录路径:/usr/local/var/mongodb