Linux环境Erlang下载安装
下载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
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
erl
halt().
Ps:若Erlang版本下载错,则需要卸载重新下载安装
# 卸载当前 Erlang
rpm -qa | grep erlang | xargs rpm -e --nodeps
# 完全卸载 Erlang yum list | grep erlang yum -y remove erlang-* rm -rf /usr/lib64/erlang
Linux环境RabbitMQ下载安装
RabbitMQ安装常见异常:https://www.cnblogs.com/mjtabu/p/14321688.html
RabbtiMQ官网下载Linux环境基础版本:https://www.rabbitmq.com/install-rpm.html#downloads
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 gpgkey
gpg gpgkey
2018年之前的签名导入(可忽略)
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 stop
Linux环境RabbitMQ卸载命令
yum list | grep rabbitmq
yum -y remove rabbitmq-server.noarch
RabbitMQ登录验证:服务器ip:post
http://168.192.1.101:15672/#/
默认用户名:guest
默认密码:guest
创建的用户名密码为:admin 123456
本站文章如无特殊说明,均为本站原创,如若转载,请注明出处:Linux环境RabbitMq搭建部署 - Python技术站