首先安装基础依赖
yum install -y socat
yum install erlang
image
Erlang 安装完毕后 配置Linux环境变量
vim /etc/profile
export ERLANG_HOME=/usr/local/lib/erlang
export PATH=$PATH:$ERLANG_HOME/bin
source /etc/profile
然后从RabbmitMQ官网下载安装包
imagewget https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.7.13/rabbitmq-server-3.7.13-1.el7.noarch.rpm
下载完毕后执行命令
rpm -ivh rabbitmq-server-3.7.13-1.el7.noarch.rpm
image
最后启动RabbmitMQ
chkconfig rabbitmq-server on
/sbin/service rabbitmq-server start
启用UI界面:
rabbitmq-plugins enable rabbitmq_management
创建用户
[root@localhost ~]# rabbitmqctl add_user shumingjian 227227
Adding user "shumingjian" ...
将其设置为管理员
[root@localhost ~]# rabbitmqctl set_user_tags shumingjian administrator
Setting tags for user "shumingjian" to [administrator] ...
创建一个虚拟主机
rabbitmqctl add_vhost vhost_name
打开管理后台
you_ip:15672
此刻,应该如图:
WechatIMG477.jpeg
常见问题:
如果你的erlang版本达不到rabbitMQ的要求版本,请执行
yum -y remove erlang*
#在/etc/yum.repos.d/rabbitmq-erlang.repo
[rabbitmq-erlang]
name = rabbitmq-erlang
baseurl = https://dl.bintray.com/rabbitmq-erlang/rpm/erlang/21/el/ 7
gpgcheck = 1
gpgkey = https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc
repo_gpgcheck = 0
enabled = 1
yum install erlang
网友评论