1.安装Erlang
创建yum源
代码语言:javascript复制sudo vi /etc/yum.repos.d/rabbitmq-erlang.repo
添加如下内容
代码语言:javascript复制[rabbitmq-erlang]
name = rabbitmq-erlang
baseurl = https://dl.bintray.com/rabbitmq-erlang/rpm/erlang/22/el/7
gpgcheck = 1
gpgkey = https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc
repo_gpgcheck = 0
enabled = 1
安装Erlang
代码语言:javascript复制sudo yum install -y erlang
安装 socat
代码语言:javascript复制yum install -y socat
2.RabbitMQ 安装
代码语言:javascript复制wget https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.7.17/rabbitmq-server-3.7.17-1.el6.noarch.rpm
下载完成后安装:
代码语言:javascript复制yum install rabbitmq-server-3.7.17-1.el6.noarch.rpm
完成后启动服务:
代码语言:javascript复制service rabbitmq-server start
可以查看服务状态:
代码语言:javascript复制service rabbitmq-server status
3.安装插件
代码语言:javascript复制/sbin/rabbitmq-plugins enable rabbitmq_management
4.Rabbit配置
添加用户
代码语言:javascript复制sudo rabbitmqctl add_user admin passworld
设置用户角色
代码语言:javascript复制sudo rabbitmqctl set_user_tags admin administrator
tag(administrator,monitoring,policymaker,management)
设置用户权限(接受来自所有Host的所有操作)
代码语言:javascript复制sudo rabbitmqctl set_permissions -p "/" admin '.*' '.*' '.*'
查看用户权限
代码语言:javascript复制sudo rabbitmqctl list_user_permissions admin
5.配置远程访问
修改配置文件
代码语言:javascript复制sudo vi /etc/rabbitmq/rabbitmq.config
保存以下内容
代码语言:javascript复制[
{rabbit, [{tcp_listeners, [5672]}, {loopback_users, ["admin"]}]}
].