官网脚本快速安装rabbitmq

最近有安装一次rabbitmq升级到3.8.5版本,这个安装真的是省事简单

直接用官方脚本运行即可

复制代码
#!/bin/sh

## If sudo is not available on the system,
## uncomment the line below to install it
# apt-get install -y sudo

sudo apt-get update -y

## Install prerequisites
sudo apt-get install curl gnupg -y

## Install RabbitMQ signing key
curl -fsSL https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc | sudo apt-key add -

## Install apt HTTPS transport
sudo apt-get install apt-transport-https

## Add Bintray repositories that provision latest RabbitMQ and Erlang 23.x releases
sudo tee /etc/apt/sources.list.d/bintray.rabbitmq.list <<EOF
## Installs the latest Erlang 23.x release.
## Change component to "erlang-22.x" to install the latest 22.x version.
## "bionic" as distribution name should work for any later Ubuntu or Debian release.
## See the release to distribution mapping table in RabbitMQ doc guides to learn more.
deb https://dl.bintray.com/rabbitmq-erlang/debian bionic erlang
## Installs latest RabbitMQ release
deb https://dl.bintray.com/rabbitmq/debian bionic main
EOF

## Update package indices
sudo apt-get update -y

## Install rabbitmq-server and its dependencies
sudo apt-get install rabbitmq-server -y --fix-missing
复制代码

启动管理平台:sudo rabbitmq-plugins enable rabbitmq_management

启停命令:

sudo rabbitmq-server start
sudo rabbitmq-server stop
sudo rabbitmq-server restart
sudo rabbitmqctl status

启动后:

rabbitmq从3.3.0开始禁止使用guest/guest权限通过除localhost外的访问,如果此时用guest:guest登陆会报错: rabbitmq User can only log in via localhost

此时需要添加用户,我们添加admin:admin。

sudo rabbitmqctl add_user  admin  admin  

赋予权限

sudo rabbitmqctl set_user_tags admin administrator

赋予virtual host中所有资源的配置、写、读权限以便管理其中的资源

sudo rabbitmqctl  set_permissions -p / admin '.*' '.*' '.*'

再次登陆成功

 

posted @   醉逍遥_001  阅读(236)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示