我试图通过跑步来运行MongoDB
brew services start mongodb-community@4.2
但我得到了你在下面看到的错误:
jaimes-mbp:SMR jaimemontoya$ brew services start mongodb-community@4.2
==> Tapping homebrew/services
Cloning into '/usr/local/Library/Taps/homebrew/homebrew-services'...
remote: Enumerating objects: 27, done.
remote: Counting objects: 100% (27/27), done.
remote: Compressing objects: 100% (19/19), done.
remote: Total 27 (delta 0), reused 16 (delta 0), pack-reused 0
Unpacking objects: 100% (27/27), done.
Checking connectivity... done.
Tapped 0 formulae (63 files, 276K)
Error: Unknown command: services
jaimes-mbp:SMR jaimemontoya$
不是吗
brew
命令,以及
services
只有一个参数?我不明白为什么错误会这么说
服务
是未知命令。非常感谢。
更新1:
当我尝试跑步时,我看到两个警告
brew install mongodb-community@4.2
再一次也许这和问题有关
jaimes-mbp:SMR jaimemontoya$ brew install mongodb-community@4.2
Warning: mongodb/brew/mongodb-community-4.2.3 already installed
Warning: You are using OS X 10.15.
We do not provide support for this pre-release version.
You may encounter build failures or other breakages.
更新2:
当我使用
mongo
,它正在做一些事情:
jaimes-mbp:SMR jaimemontoya$ mongo
MongoDB shell version v4.2.3
connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
2020-03-13T06:41:22.073-0600 E QUERY [js] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed: SocketException: Error connecting to 127.0.0.1:27017 :: caused by :: Connection refused :
connect@src/mongo/shell/mongo.js:341:17
@(connect):2:6
2020-03-13T06:41:22.076-0600 F - [main] exception: connect failed
2020-03-13T06:41:22.076-0600 E - [main] exiting with code 1
jaimes-mbp:SMR jaimemontoya$
也许我不需要使用
brew服务启动mongodb-community@4.2
? 我认为有必要运行MongoDB社区版。
更新3:
我跑
ps aux | grep -v grep | grep mongod
它什么也不返回。我试图验证MongoDB是否正在运行,所以我正在搜索
mongod
在我运行的进程中,但它没有返回任何内容,这意味着MongoDB没有运行。
更新4:
看看我跑的时候会发生什么
brew doctor --verbose
:
Warning: You are using OS X 10.15.
We do not provide support for this pre-release version.
You may encounter build failures or other breakages.
Warning: Your Homebrew is outdated.
You haven't updated for at least 24 hours. This is a long time in brewland!
To update Homebrew, run `brew update`.
Warning: The /usr/local directory is not writable.
Even if this directory was writable when you installed Homebrew, other
software may change permissions on this directory. Some versions of the
"InstantOn" component of Airfoil are known to do this.
您可能应该更改/usr/local的所有权和权限
返回您的用户帐户。
sudo chown-R$(whoami):admin/usr/local
当我跑的时候
sudo chown -R $(whoami):admin /usr/local
jaimes-mbp:SMR jaimemontoya$ sudo chown -R $(whoami):admin /usr/local
Password:
chown: /usr/local: Operation not permitted
jaimes-mbp:SMR jaimemontoya$
brew update
不起作用:
jaimes-mbp:SMR jaimemontoya$ brew update
Error: The /usr/local directory is not writable.
Even if this directory was writable when you installed Homebrew, other
software may change permissions on this directory. Some versions of the
"InstantOn" component of Airfoil are known to do this.
You should probably change the ownership and permissions of /usr/local
back to your user account.
sudo chown -R $(whoami):admin /usr/local
jaimes-mbp:SMR jaimemontoya$