-bash:rabbitmq-server:找不到命令

时间:2017-09-25 07:06:14

标签: bash macos terminal rabbitmq

尝试启动我的rabbitmq服务器,但是我收到了这个错误。我已按照how to install it上的所有说明进行操作。 rabbitmq-server文件位于/usr/local/sbin内。所以我将目录更改为sbin,并在我的终端中写入rabbitmq-server,但它显示错误-bash: rabbitmq-server: command not found。我已根据说明在export PATH=/usr/local/sbin:$PATH的底部添加了以下行:bash_profile。知道为什么它不工作吗?

2 个答案:

答案 0 :(得分:4)

请试试这个,

导航到'RabbitMQ Server \ rabbitmq_server-VERSION \ sbin'路径,然后按照以下步骤操作,

  1. 运行命令'rabbitmqctl status'。您将获得完整状态(这只是检查状态)。
  2. 现在运行'rabbitmq-plugins enable rabbitmq_management'
  3. 运行命令'rabbitmqctl stop'
  4. 运行命令'rabbitmq-service start'
  5. 在浏览器中转到localhost:15672
  6. 现在您应该可以看到RabbitMQ管理插件,这意味着所有服务都运行良好。您可以尝试使用guest登录作为用户名和密码登录,这是默认用户名和密码。

答案 1 :(得分:1)

我希望使用此命令:

brew services run rabbitmq

我觉得它与systemd更相似。

brew services command:
Integrates Homebrew formulae with macOS' launchctl manager.

[sudo] brew services list
List all running services for the current user (or root)

[sudo] brew services run formula|--all
Run the service formula without starting at login (or boot).

[sudo] brew services start formula|--all
Start the service formula immediately and register it to launch at login (or boot).

[sudo] brew services stop formula|--all
Stop the service formula immediately and unregister it from launching at login (or boot).

[sudo] brew services restart formula|--all
Stop (if necessary) and start the service immediately and register it to launch at login (or boot).

[sudo] brew services cleanup
Remove all unused services.