MacOS安装RabbitMQ

官网地址:

RabbitMQ: easy to use, flexible messaging and streaming — RabbitMQ

一、brew安装

brew update #更新一下homebrew
brew install rabbitmq   #安装rabbitMQ 

安装结果:

==> Caveats
==> rabbitmq
Management Plugin enabled by default at http://localhost:15672

To restart rabbitmq after an upgrade:
  brew services restart rabbitmq
Or, if you don't want/need a background service you can just run:
  CONF_ENV_FILE="/opt/homebrew/etc/rabbitmq/rabbitmq-env.conf" /opt/homebrew/opt/rabbitmq/sbin/rabbitmq-server

 rabbitmq 的安装路径:

/opt/homebrew/opt/rabbitmq

二、配置环境变量

1、

vi ~/.bash_profile

2、 

export RABBIT_HOME=${PATH}:/opt/homebrew/opt/rabbitmq
export PATH=${PATH}:$RABBIT_HOME/sbin

3、 

source ~/.bash_profile

三、启动RabbitMQ

1、前台运行
rabbitmq-server

2、后台运行
rabbitmq-server -detached

3、查看运行状态
rabbitmqctl status

4、开始 Web插件
rabbitmq-plugins enable rabbitmq_management

5、重启
rabbitmq-server restart

5、关闭
rabbitmqctl stop

四、访问

1、浏览器地址


http://localhost:15672/
默认用户名和密码为guest

添加用户
rabbitmqctl add_user miaojiang 123

设置用户为管理员
rabbitmqctl set_user_tags miaojiang administrator

配置用户可以远程登录
rabbitmqctl set_permissions -p "/" miaojaing ".*" ".*" ".*"

查看新添加的账户

rabbitmqctl list_users

查看用于的权限
rabbitmqctl list_permissions -p /

五、参考:

MacOS安装RabbitMQ消息中间件(亲测有效 直接CV)_mac 运行rabbitmq_Dkrillex的博客-CSDN博客

你可能感兴趣的:(MQ消息服务器,rabbitmq)