原文参考:
安装Homebrew
参见:
安装RabbitMQ
#自动升级homebrewbrew update#安装RabbitMQ serverbrew install rabbitmq
安装完成后用brew info rabbitmq
检查信息:
rabbitmq: stable 3.7.3Messaging brokerhttps://www.rabbitmq.com/usr/local/Cellar/rabbitmq/3.7.2 (232 files, 12.6MB) * Built from source on 2018-01-02 at 09:45:16From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/rabbitmq.rb==> DependenciesRequired: erlang ✔==> CaveatsManagement Plugin enabled by default at http://localhost:15672Bash completion has been installed to: /usr/local/etc/bash_completion.dTo have launchd start rabbitmq now and restart at login: brew services start rabbitmqOr, if you don't want/need a background service you can just run: rabbitmq-server
- 默认安装地址:
/usr/local/sbin
- 默认用户名:
guest
,密码:guest
。(仅支持本地连接) - 默认 Virtual Host:
/
- 默认 TCP Listener:
127.0.0.1:5672
- 默认log:
/usr/local/var/log/rabbitmq/rabbit@localhost.log
添加环境变量:
#用vi指令进入vi ~/.bash_profile#添加环境变量RABBITMQ_HOME=/usr/local/sbinPATH=$PATH:$RABBITMQ_HOME#保存退出:wq#指令生效source ~/.bash_profile
启动RabbitMQ
#直接启动rabbitmq-server#后台启动rabbitmq-server -detached#查询进程ps -ef|grep rabbitmq#本地登录地址http://localhost:15672#关闭rabbitmqctl stop#检查状态rabbitmqctl status#默认日志/usr/local/var/log/rabbitmq/rabbit@localhost.log
用户管理(部分指令)
利用rabbitmqctl
管理 RabbitMQ 内部用户数据信息
- username password
rabbitmqctl add_user tonyg changeit
- username
rabbitmqctl delete_user tonyg
- username newpassword
rabbitmqctl delete_user tonyg
- username
rabbitmqctl clear_password tonyg
RabbitMQ 提供了官方标准的配置文件样例:
参考: