下载erlang
wget --content-disposition --no-check-certificate https://packagecloud.io/rabbitmq/erlang/packages/el/7/erlang-23.3.4.11-1.el7.x86_64.rpm/download.rpm?distro_version_id=140
下载rabbitmq
不同版本rabbitmq对erlang的依赖版本不同,可通过官网查找对应关系。
rabbitmq
wget --content-disposition --no-check-certificate https://packagecloud.io/rabbitmq/rabbitmq-server/packages/el/7/rabbitmq-server-3.9.16-1.el7.noarch.rpm/download.rpm?distro_version_id=140
安装erlang
rabbitmq-server依赖于erlang,所以需要先安装erlang.
rpm -Uvh erlang-23.3.4.11-1.el7.x86_64.rpm
yum install -y erlang
安装rabbitmq-server
rpm -Uvh rabbitmq-server-3.9.16-1.el7.noarch.rpm
yum install -y rabbitmq-server
启动rabbitmq-server
systemctl start rabbitmq-server
启动管理界面
rabbitmq-plugins enable rabbitmq_management
测试安装是否成功
systemctl status rabbitmq-server
如果出现以下active
字样,安装成功。
root@localhost rabbitmq]# systemctl status rabbitmq-server
● rabbitmq-server.service - RabbitMQ broker
Loaded: loaded (/usr/lib/systemd/system/rabbitmq-server.service; disabled; vendor preset: disabled)
Active: active
(running) since Fri 2022-11-25 15:41:30 CST; 9s ago
Main PID: 18193 (beam.smp)
Tasks: 21
CGroup: /system.slice/rabbitmq-server.service
├─18193 /usr/lib64/erlang/erts-11.2.2.7/bin/beam.smp -W w -MBas ageffcbf ...
├─18212 erl_child_setup 32768
├─18252 inet_gethost 4
└─18253 inet_gethost 4
浏览器访问 http://127.0.0.1:15672/
用户名密码:guest/guest。
默认guest用户是只能在本机登录rabbitmq的管理界面的,如果需要远程登录管理界面,需要配置用户权限。
创建新的用户名密码并赋远程访问权限
创建用户
命令格式: rabbitmqctl
add_user
[username] [password]
rabbitmqctl add_user root 123456
设置用户角色
命令格式: rabbtmqctl
set_user_tags
[username] [role]
rabbitmqctl set_user_tags root administrator
设置用户权限
命令格式: rabbtmqctl
set_permissions
-p / [username] "." "." ".*", /
代表根。
标签:16,--,rabbitmq,server,centos7,rabbitmqctl,rabbitmq3.9,erlang,rpm From: https://www.cnblogs.com/jeanerk/p/16925507.htmlrabbitmqctl set_permissions -p / root "." "." ".*"