赞
踩
温馨提醒:使用homebrew安装rabbitmq前,先更新下homebrew,更新命令: brew update
- # 安装
- brew install rabbitmq
- # 使用homebrew 查看rabbitmq安装路径和版本信息
- brew info rabbitmq
export PATH=/usr/local/Cellar/rabbitmq/3.10.7/sbin:$PATH
- # 启动
- sudo rabbitmq-server
- # 后台启动命令
- sudo rabbitmq-server -detached
- # 查询rabbitmq的状态
- sudo rabbitmqctl status
- # 访问rabbitmq主页
- http://localhost:15672/
注意:默认是账户名和密码都是:“guest”,表示来宾客户。
由于账号guest具有所有的操作权限,且是默认账号,出于安全因素的考虑,guest用户只能通过localhost登陆使用,并建议修改guest用户的密码以及新建其他账号管理使用rabbitmq。
- # 启动服务
- sudo rabbitmq-server
-
- # 启动插件
- sudo rabbitmq-plugins enable rabbitmq_management
-
- # 关闭服务
- sudo rabbitmqctl stop
-
- # rabbitmq 后台启动命令
- sudo rabbitmq-server -detached
-
- # 查找rabbitmq在哪
- find / -name 'rabbitmq' -type d
-
- # rabbitmq内存限制
- # 系数计算,假设机器内存32g,以下命令限制的最高内存为,32*0.06=1.92g
- rabbitmqctl set_vm_memory_high_watermark 0.06
-
- # rabbitmq添加消息日志记录
- rabbitmq-plugins enable rabbitmq_tracing
-
- # 查询rabbitmq的进程
- ps -ef | grep rabbitmq
-
- # 杀掉rabbitmq进程
- ps -ef | grep rabbitmq | grep -v grep | awk '{print $2}' | xargs kill -9
-
- # 查询rabbitmq的状态
- sudo rabbitmqctl status
brew install rabbitmq
- # 如果未配置homebrew的环境变量
- echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.zshrc
- # 进行mq安装
- brew install rabbitmq
-
- # 产生报错
- ==> Installing dependencies for rabbitmq: ca-certificates, openssl@1.1, jpeg, libpng, libtiff, wxwidgets and erlang
- ==> Installing rabbitmq dependency: ca-certificates
- fatal: not in a git directory
- Error: Command failed with exit 128: git
- # 此处显示找不到git,但实际上git已经安装了,查看一下brew版本
-
- brew -v
- # 显示brew没有添加进git仓库
-
- 此时已经发现问题了,brew与git没有建立关联,那么执行一下如下命令即可
- cd "$(brew --repo)"
- git remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git
- cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
- git remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git
- cd "$(brew --repo)/Library/Taps/homebrew/homebrew-cask"
- git remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-cask.git
- brew update
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。