RabbitMQ安装文档
- RabbitMQ官网下载地址:https://www.rabbitmq.com/download.html
1.安装依赖
-
在线安装依赖环境:
shellyum install build-essential openssl openssl-devel unixODBC unixODBC-devel make gcc gcc-c++ kernel-devel m4 ncurses-devel tk tc xz
2.安装环境
-
上传安装包到linux 环境
2.1安装erlang环境
java
rpm -ivh erlang-23.3.4.5-1.el7.x86_64.rpm
-
如果出现如下错误
-
使用yum升级gblic 版本
shellsudo yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make -y
2.2安装rabbitMQ
-
安装socat
shellyum install socat -y
-
安装rabbitMQ
shellrpm -ivh rabbitmq-server-3.8.34-1.suse.noarch.rpm
-
开启管理界面
shellrabbitmq-plugins enable rabbitmq_management
-
启动rabbitmq
shell/bin/systemctl start rabbitmq-server.service
2.3rabbitMQ操作
-
开放端口
shellfirewall-cmd --zone=public --add-port=15672/tcp --permanent firewall-cmd --zone=public --add-port=5672/tcp --permanent firewall-cmd --reload
-
查看服务状态
shell/sbin/service rabbitmq-server status
-
停止服务
shell/sbin/service rabbitmq-server stop
-
添加开机自启动
shellchkconfig rabbitmq-server on
3.添加用户密码
-
添加账户密码
shellrabbitmqctl add_user sy 123456
-
设置角色
javarabbitmqctl set_user_tags sy administrator
-
设置用户权限
shellrabbitmqctl set_permissions -p "/" sy ".*" ".*" ".*"
-
查看用户和角色
shellrabbitmqctl list_users
4.重置命令
-
关闭rabbitMQ
shellrabbitmqctl stop_app
-
重置命令
shellrabbitmqctl reset
-
重新启动
shellrabbitmqctl start_app
5.服务出问题
-
查看主机名称
shellhostnamectl status
-
重新设置一下主机名称
shellhostnamectl set-hostname localhost.localdomain