离线安装rabbitmq
安装包下载
版本介绍:https://www.rabbitmq.com/install-rpm.html
rabbitmq版本: 3.6.10
1 | wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.6.10/rabbitmq-server-generic-unix-3.6.10.tar.xz |
erlang版本:
https://www.erlang.org/downloads
otp_src_20.2.tar.gz
erlang安装
安装中提示 curses notfond 手动安装 cureses包
http://ftp.gnu.org/gnu/ncurses/ 下载最新版ncureses
1 | # tar -zxvf ncurses-6.1.tar.gz |
安装erlang
1 | cd otp_src_19.3 |
rabbitmq安装
rpm -ivh rabbitmq-server-3.7.4-1.el7.noarch.rpm
提示
1 | tar -Jxvf rabbitmq-server-generic-unix-3.6.10.tar.xz |
rabbitmq基本操作
rabbitMQ启动
1 | cd /mnt/data/rabbitmq/sbin |
开启Web管理插件
1 | cd /usr/local/rabbitmq/sbin |
rabbitMQ重启
1 | cd /usr/local/rabbitmq/sbin |
通过web管理
访问http://localhost:15672
默认用户/密码 : guest/guest
注意初始状态只能本地登录,不可通过远程web访问,给权限也不行。需要远程访问的,必须新建用户并赋权限。
用户管理并赋权限
- 添加用户
如用户名:mqadmin 密码:mqadmin
1 | cd /usr/local/rabbitmq/sbin |
- 给用户添加角色
角色有none、management、policymaker、monitoring、administrator等,administrator为超级管理员
1 | ./rabbitmqctl set_user_tags mqadmin administrator |
- 给用户授权
1 | ./rabbitmqctl set_permissions -p / mqadmin '.*' '.*' '.*' |
在浏览器中输入:http://ip:15672
端口 | 说明 |
---|---|
4369 | epmd, a peer discovery service used by RabbitMQ nodes and CLI tools |
5672, 5671 | used by AMQP 0-9-1 and 1.0 clients without and with TLS |
25672 | used by Erlang distribution for inter-node and CLI tools communication and is allocated from a dynamic range (limited to a single port by default, computed as AMQP port + 20000). See networking guide for details. |
15672 | HTTP API clients and rabbitmqadmin (only if the management plugin is enabled) |
61613, 61614 | STOMP clients without and with TLS (only if the STOMP plugin is enabled) |
1883, 8883 | (MQTT clients without and with TLS, if the MQTT plugin is enabled |
15674 | STOMP-over-WebSockets clients (only if the Web STOMP plugin is enabled) |
15675 | MQTT-over-WebSockets clients (only if the Web MQTT plugin is enabled) |