RabbitMQ 初级教程[0] - Mac下安装

原文参考:Downloading and Installing RabbitMQ - MacOS: Homebrew

安装Homebrew

参见:Homebrew

安装RabbitMQ

#自动升级homebrew
brew update

#安装RabbitMQ server
brew install rabbitmq

安装完成后用brew info rabbitmq检查信息:

rabbitmq: stable 3.7.3
Messaging broker
https://www.rabbitmq.com
/usr/local/Cellar/rabbitmq/3.7.2 (232 files, 12.6MB) *
  Built from source on 2018-01-02 at 09:45:16
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/rabbitmq.rb
==> Dependencies
Required: erlang ✔
==> Caveats
Management Plugin enabled by default at http://localhost:15672

Bash completion has been installed to:
  /usr/local/etc/bash_completion.d

To have launchd start rabbitmq now and restart at login:
  brew services start rabbitmq
Or, 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/[email protected]

添加环境变量:

#用vi指令进入
vi ~/.bash_profile

#添加环境变量
RABBITMQ_HOME=/usr/local/sbin
PATH=$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/[email protected]

用户管理(部分指令)

利用rabbitmqctl 管理 RabbitMQ 内部用户数据信息

rabbitmqctl add_user tonyg changeit
rabbitmqctl delete_user tonyg
rabbitmqctl delete_user tonyg
rabbitmqctl clear_password tonyg

RabbitMQ 提供了官方标准的配置文件样例:rabbitmq.conf.example

参考:RabbitMQ - configure

相关推荐