1.下载erlang仓库
wget http://packages.erlang-solutions.com/erlang-solutions-1.0-1.noarch.rpm
- 安装rpm仓库
rpm -Uvh erlang-solutions-1.0-1.noarch.rpm
如果报错:error: Failed dependencies: epel-release is needed by erlang-solutions-1.0-1.noarch
缺少依赖:
yum install epel-release
- 安装erlang
yum -y install erlang
2.安装rabbitmq
-
下载rabbitmq
wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.6.6/rabbitmq-server-3.6.6-1.el6.noarch.rpm -
yum安装rabbitMQ
yum -y install rabbitmq-server-3.6.6-1.el6.noarch.rpm
注:
如果报:Requires: socat
更新源:
wget –no-cache http://www.convirture.com/repos/definitions/rhel/6.x/convirt.repo -O /etc/yum.repos.d/convirt.repo
yum安装socat
yum install socat
3.启动rabbitmq
- 前台运行:rabbitmq-server start (用户关闭连接后,自动结束进程)
- 后台运行:rabbitmq-server -detached
如果无法启动,到根目录下:cd /usr/lib/rabbitmq/lib/rabbitmq_server-3.6.6/sbin/ 用命令启动
./rabbitmq-server
4.安装插件
- 启动web管理界面
rabbitmq-plugins enable rabbitmq_management
默认的登陆账号为:guest 密码为:guest
默认用户guest只能本地访问
增加访问用户
rabbitmqctl add_user admin admin
设置角色: 用户设置为administrator才能远程访问
rabbitmqctl set_user_tags admin administrator
设置默认vhost(“/”)访问权限
set_permissions -p / admin "." "." ".*"
浏览器打开 http://localhost:15672
5.用户管理
(1) 新增一个用户
rabbitmqctl add_user Username Password
(2) 删除一个用户
rabbitmqctl delete_user Username
(3) 修改用户的密码
rabbitmqctl change_password Username Newpassword
(4) 查看当前用户列表
rabbitmqctl list_users
网友评论