yum 安装 rabbitmq && 创建管理账号 配置权限
blank
blank
发布于 2019-03-28 / 514 阅读 / 0 评论 / 0 点赞

yum 安装 rabbitmq && 创建管理账号 配置权限

先安装rabbitmq 依赖 erlang

导入erlang官方yum源

yum install -y epel-release
wget https://packages.erlang-solutions.com/erlang-solutions-1.0-1.noarch.rpm
rpm -Uvh erlang-solutions-1.0-1.noarch.rpm

构建yum缓存

yum clean all && yum makecache

安装erlang

# yum install -y erlang

验证安装

# erl

安装rabbitmq-server

创建rabbitmq-server yum源

# vim /etc/yum.repos.d/rabbitmq-server.repo
[bintray-rabbitmq-server]
name=bintray-rabbitmq-rpm
baseurl=https://dl.bintray.com/rabbitmq/rpm/rabbitmq-server/v3.7.x/el/7/
gpgcheck=1
gpgkey=https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc
repo_gpgcheck=0
enabled=1

安装rabbitmq-server

# yum install -y rabbitmq-server

启动rabbitmq-server && 开机自启

# systemctl start rabbitmq-server && systemctl enable rabbitmq-server

检查服务运行状态

# systemctl status rabbitmq-server

启用rabbitmq management ui

# rabbitmq-plugins enable rabbitmq_management
Enabling plugins on node rabbit@renice:
rabbitmq_management
The following plugins have been configured:
  rabbitmq_management
  rabbitmq_management_agent
  rabbitmq_web_dispatch
Applying plugin configuration to rabbit@renice...
The following plugins have been enabled:
  rabbitmq_management
  rabbitmq_management_agent
  rabbitmq_web_dispatch
started 3 plugins.

创建账号 test 密码 tset

# rabbitmqctl add_user test test
Adding user "test" ...

将 test 账号设置为管理员

# rabbitmqctl set_user_tags test administrator
Setting tags for user "test" to [administrator] ...

给 test 账号授权

# rabbitmqctl set_permissions -p / test ".*" ".*" ".*"
Setting permissions for user "test" in vhost "/" ...

访问服务器ip:15672 test/test 默认账号密码 guest/guest 只能本地访问


评论