下载erlang,原因在于RabbitMQ服务端代码是使用并发式语言Erlang编写的
创建文件夹mkdir rabbitMQ安装Erlang环境所需相关依赖
yum install epel-release yum install gcc gcc-c++ glibc-devel make ncurses-devel openssl-devel autoconf java-1.8.0-openjdk-devel git wget wxBase.x86_64查看RabbitMq与Erlang的对应版本:https://www.rabbitmq.com/which-erlang.html
Linux环境Erlang下载:https://www.erlang-solutions.com/resources/download.html
复制下载链接,Linux命令下载
wget https://packages.erlang-solutions.com/erlang/rpm/centos/7/x86_64/esl-erlang_23.2-1~centos~7_amd64.rpm赋予其执行权限
chmod -R +x esl-erlang_23.2-1~centos~7_amd64.rpm自由互联热门推荐:PDF电子发票识别软件,一键识别电子发票并导入到Excel中!10大顶级数据挖掘软件!人工智能的十大作用! Erlang环境安装
rpm esl-erlang_23.2-1~centos~7_amd64.rpm
yum install esl-erlang_23.2-1~centos~7_amd64.rpm
Eralng环境erl 查看,halt().退出Erlang
erlPs:若Erlang版本下载错,则需要卸载重新下载安装
halt().
# 卸载当前 ErlangLinux环境RabbitMQ下载安装 RabbitMQ安装常见异常:https://www.cnblogs.com/mjtabu/p/14321688.html RabbtiMQ官网下载Linux环境基础版本:https://www.rabbitmq.com/install-rpm.html#downloads
rpm -qa | grep erlang | xargs rpm -e --nodeps
# 完全卸载 Erlang yum list | grep erlang yum -y remove erlang-* rm -rf /usr/lib64/erlang
Ps:RabbitMq的版本一定要与Erlang环境对应
wget https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.8.11/rabbitmq-server-3.8.11-1.el8.noarch.rpm赋予RabbitMq执行权限
rabbitmq-server-3.8.11-1.el8.noarch.rpm导入签名:https://www.rabbitmq.com/signatures.html
curl -L https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey \ > -O packagecloud-rabbitmq-key.asc -s赋予执行签名权限
chmod -R +x gpgkey2018年之前的签名导入(可忽略)
gpg gpgkey
rpm --import https://www.rabbitmq.com/rabbitmq-signing-key-public.asc安装RabbitMq,此处容易出现安装错误,无外乎Erlang版本不一致,参考以上Erlang卸载,重装RabbitMq对应版本即可
yum install rabbitmq-server-3.8.11-1.el8.noarch.rpm启动RabbitMq服务
systemctl start rabbitmq-server添加管理员账号
rabbitmqctl add_user admin 123456分配用户标签
rabbitmqctl set_user_tags admin administrator创建和赋角色完成后查看并确认
rabbitmqctl list_users查看rabbitmq的运行状态
ps -ef | grep rabbitmq
rabbitmqctl status关闭rabbitmq
rabbitmqctl stopLinux环境RabbitMQ卸载命令
yum list | grep rabbitmq yum -y remove rabbitmq-server.noarchRabbitMQ登录验证:服务器ip:post
http://168.192.1.101:15672/#/
默认用户名:guest
默认密码:guest
创建的用户名密码为:admin 123456