一、安装erlang
# 添加仓库
curl -s https://packagecloud.io/install/repositories/rabbitmq/erlang/script.rpm.sh | sudo bash
Detected operating system as centos/8.
# 安装erlang
dnf install erlang
二、导入密钥
rpm --import https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc
三、在/etc/yum.repos.d目录下添加rabbitmq.repo文件,内容如下:
[bintray-rabbitmq-server]
name=bintray-rabbitmq-rpm
baseurl=https://dl.bintray.com/rabbitmq/rpm/rabbitmq-server/v3.8.x/el/8/
gpgcheck=0
repo_gpgcheck=0
enabled=1
四、下载rabbitmq
wget https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.8.1/rabbitmq-server-3.8.1-1.el8.noarch.rpm
--2019-12-21 03:03:48-- https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.8.1/rabbitmq-server-3.8.1-1.el8.noarch.rpm
五、安装rabbitmq
dnf install rabbitmq-server-3.8.1-1.el8.noarch.rpm
六、设置开机起动
chkconfig rabbitmq-server on
七、起动、停止命令
/sbin/service rabbitmq-server start
/sbin/service rabbitmq-server stop
八、启动插件
rabbitmq-plugins enable rabbitmq_management
九、使用http://ip:15672登录,默认用户为guest,密码为guest
提示:
说只能通过localhost来登录
创建用户用于远程登录:
# create a user
rabbitmqctl add_user full_access s3crEt
# tag the user with "administrator" for full management UI and HTTP API access
rabbitmqctl set_user_tags full_access administrator
创建用户时报错如下信息:
把端口25672,4369放开后还是报上述错误,最后在https://blog.csdn.net/y_k_y/article/details/81350274 中找到了解决办法,在/etc/hosts文件中把主机名添加进去
添加前
添加后
十、设置添加的用户为管理员权限,上一步有命令
十一、给新用户所有权限
rabbitmqctl set_permissions -p / admin ".*" ".*" ".*"