通过Brew指令安装RabbitMQ
brew指令可以安装、更新和卸载应用,通过brew指令安装RabbitMQ很简单。打开新的终端窗口,回到根目录之后输入 brew install rabbitmq指令即可进行rabbitmq服务的自动安装。
安装完成之后,接下来就可以启动了,进入安装目录,执行命令:
./sbin/rabbitmq-server
接下来可以在浏览器打开 http://localhost:15672,可以看到 RabbitMQ 的管理页面。
注:如果brew很慢,可以切换国内源
cd "$(brew --repo)"
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
brew update
如果发现
Error: An exception occurred within a child process:
DownloadError: Failed to download resource "rabbitmq"
Download failed: https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.8.2/rabbitmq-server-generic-unix-3.8.2.tar.x
进入sudo vim /etc/hosts 把关于github的注释掉
启动
前台启动
rabbitmq-server
后台启动
brew services start rabbitmq
注:如果还是无法解决无法连接github,请参考
https://www.jianshu.com/p/f3c916a1866b