因为RabbitMQ是由erlang实现的,所以要先安装erlang再安装rabbitMQ
1、先配置yum软件源地址EPEL(EPEL是管理yum下载软件的软件,也可以说是一个软件仓库)后安装erlang
安装前检查是否已经安装过EPEL,命令:yum repolist
如果已经安装,就不需执行下面的安装命令了
下载EPEL地址:wget https://mirrors.tuna.tsinghua.edu.cn/epel/7/x86_64/Packages/e/epel-release-7-11.noarch.rpm
安装命令1:rpm -ivh epel-release-7-11.noarch.rpm
安装命令2:rpm -ivh https://mirrors.tuna.tsinghua.edu.cn/epel/7/x86_64/Packages/e/epel-release-7-11.noarch.rpm
卸载命令:rpm -e epel-release
2、安装erlang(通过yum源来安装)
下载命令:wget http://packages.erlang-solutions.com/erlang-solutions-1.0-1.noarch.rpm
加入yum源:rpm -Uvh erlang-solutions-1.0-1.noarch.rpm
开始安装:yum install erlang,如图
3、安装rabbitmq
下载地址命令:wget https://dl.bintray.com/rabbitmq/all/rabbitmq-server/3.7.4/rabbitmq-server-3.7.4-1.el7.noarch.rpm
安装命令:yum install rabbitmq-server-3.7.4-1.el6.noarch.rpm,如图
以上rabbitmq安装成功了,开始配置rabbitmq
4、配置rabbitmq
先查看服务状态:
命令1:systemctl status rabbitmq-server.service
命令2:service rabbitmq-server status,如图:未启动服务
启动服务命令1:systemctl start rabbitmq-server.service
启动服务命令2:service rabbitmq-server start
启动服务命令3:/sbin/service rabbitmq-server start
查看当前用户命令:rabbitmqctl list_users
创建用户:rabbitmqctl add_user admin 123456
将用户给于管理员权限:rabbitmqctl set_user_tags admin administrator
启用WEB管理界面:rabbitmq-plugins enable rabbitmq_management
以上rabbitmq安装并配置成功!!!
rabbitmq 一些基础命令:
删除一个用户:rabbitmqctl delete_user guest 修改用户的密码:rabbitmqctl change_password admin admin@test 查看所有队列消息:rabbitmqctl list_queues 清除所有队列: rabbitmqctl reset 启动1:service rabbitmq-server start;启动2:/sbin/service rabbitmq-server start 停止:service rabbitmq-server stop 重启:service rabbitmq-server restart 查看状态:rabbitmqctl status
额外可能需要依赖:安装rabbitmq依赖项socat
- 官方地址:https://pkgs.org/download/socat
- 下载文件地址:http://dl.fedoraproject.org/pub/epel/6/x86_64/Packages/s/socat-1.7.2.3-1.el6.x86_64.rpm
- 安装命令:rpm -Uvh socat-1.7.2.3-1.el6.x86_64.rpm