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

3
尝试启动rabbitmq服务器,但出现了错误。我已经按照安装指南中的所有说明进行操作。 rabbitmq-server文件存储在/usr/local/sbin目录下。所以我转到sbin目录,并在终端中键入rabbitmq-server,但显示出错信息-bash: rabbitmq-server: command not found。根据指南,在我的bash_profile底部已经添加了以下行:export PATH=/usr/local/sbin:$PATH,为什么还会出现此问题呢?

在你的bash_profile中添加路径后,你是否运行了source bash_profile命令? - P....
2
你尝试运行过这个命令吗:"source bash_profile"?在修改了该文件后,需要执行此命令。 - user54
那就是问题所在,现在它已经可以工作了。谢谢! - Zorgan
它可以从命令行重新加载.bash_profile。 - user54
2个回答

7
请尝试以下操作:

进入路径“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。

现在,您应该能够看到RabbitMQ管理插件,这意味着所有服务都正常运行。您可以尝试使用guest作为用户名和密码登录,这是默认设置。


2
我更喜欢这个命令: 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.

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接