环境
- 操作系统CentOS7
安装
准备安装包
bash
# rabbitmq基于erlang语言开发,需先安装erlang语言解释器
[root@node2 ~]# ls
erlang-21.3-1.el7.x86_64.rpm rabbitmq-server-3.8.8-1.el7.noarch.rpm
[root@node2 ~]# rpm -ivh erlang-21.3-1.el7.x86_64.rpm
#安装socat依赖
[root@node2 ~]# yum install -y socat
#安装rabbitmq3.8.8
[root@node2 ~]# rpm -ivh rabbitmq-server-3.8.8-1.el7.noarch.rpm
#设置开启自启,并启动rabbitmq-server
[root@node2 ~]# systemctl enable rabbitmq-server --now
#开启web功能
[root@node2 ~]# rabbitmq-plugins enable rabbitmq_management
#重新启动rabbitmq-server
[root@node2 ~]# systemctl restart rabbitmq-server
[root@node2 ~]# netstat -tnlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:4369 0.0.0.0:* LISTEN 2645/epmd
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 923/sshd
tcp 0 0 0.0.0.0:15672 0.0.0.0:* LISTEN 2515/beam.smp
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1157/master
tcp 0 0 0.0.0.0:25672 0.0.0.0:* LISTEN 2515/beam.smp
tcp6 0 0 :::4369 :::* LISTEN 2645/epmd
tcp6 0 0 :::22 :::* LISTEN 923/sshd
tcp6 0 0 ::1:25 :::* LISTEN 1157/master
tcp6 0 0 :::5672 :::* LISTEN 2515/beam.smp
bash
#添加用户,并设置权限
[root@node2 ~]# rabbitmqctl add_user admin 123
[root@node2 ~]# rabbitmqctl set_user_tags admin administrator
Setting tags for user "admin" to [administrator] ...
[root@node2 ~]# rabbitmqctl set_permissions -p "/" admin ".*" ".*" ".*"
Setting permissions for user "admin" in vhost "/" ...