Erlang版本与Rabbitmq的版本一定要匹配,查看版本匹配情况看这里https://www.rabbitmq.com/which-erlang.html
1:先安装erlang(网站:https://www.erlang-solutions.com/resources/download.html)
- 添加存储库条目
要将Erlang Solutions存储库(包括用于验证已签名软件包的公共密钥)添加到您的系统,请调用以下命令:
wget https://packages.erlang-solutions.com/erlang-solutions-2.0-1.noarch.rpm
rpm -Uvh erlang-solutions-2.0-1.noarch.rpm
或者:手动添加存储库条目
RPM软件包已签名。要添加Erlang Solutions键,请执行以下命令:
rpm --import https://packages.erlang-solutions.com/rpm/erlang_solutions.asc
将以下行添加到“ /etc/yum.repos.d/”中的某个文件中:
[erlang-solutions]
name=CentOS $releasever - $basearch - Erlang Solutions
baseurl=https://packages.erlang-solutions.com/rpm/centos/$releasever/$basearch
gpgcheck=1
gpgkey=https://packages.erlang-solutions.com/rpm/erlang_solutions.asc
enabled=1
- 添加具有依赖性的存储库(参考:https://fedoraproject.org/wiki/EPEL/zh-cn)
yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
dnf config-manager --set-enabled PowerTools
- 安装Erlang
sudo yum install erlang
验证Erlang安装完成,检查erlang的版本号,因为要和rabbitmq有匹配关系。
erl
halt(). 退出erl,7个字符,最后那个【.】别丢了
2:安装RabbitMQ(下载地址:https://www.rabbitmq.com/download.html)
yum install socat
- 安装RabbitMQ
rpm -ivh rabbitmq-server-3.8.16-1.el8.noarch.rpm
安装web管理插件
rabbitmq-plugins enable rabbitmq_management
启动服务
service rabbitmq-server start
service rabbitmq-server status //查看服务状态
service rabbitmq-server restart //重启服务
service rabbitmq-server stop //停止服务
启用插件页面管理
rabbitmq-plugins enable rabbitmq_management
创建用户
rabbitmqctl add_user admin mypassword
赋予权限
rabbitmqctl set_user_tags admin administrator rabbitmqctl set_permissions -p / admin ".*" ".*" ".*"