查看端口运行情况
代码语言:javascript复制[root@h102 rabbitmq]# netstat -an | grep -E "(4369|25672|5672|5671|15672|61613|61614|1883|8883)"
tcp 0 0 0.0.0.0:4369 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:25672 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:49602 127.0.0.1:4369 ESTABLISHED
tcp 0 0 127.0.0.1:4369 127.0.0.1:49602 ESTABLISHED
tcp 0 0 192.168.100.102:4369 192.168.100.102:52333 TIME_WAIT
tcp 0 0 :::5672 :::* LISTEN
[root@h102 rabbitmq]#
Tip: 在 /etc/security/limits.conf 中修改系统的文件句柄数,这个参数对会产生大量连接,需要打开很多文件的服务有制约作用,系统的默认1024比较保守,可以满足开发需求,但无法满足生产需求
rabbitmqctl基础操作
日常管理主要使用 rabbitmqctl
关闭node
代码语言:javascript复制[root@h102 rabbitmq]# rabbitmqctl stop
Stopping and halting node rabbit@h102 ...
[root@h102 rabbitmq]# rabbitmqctl status
Status of node rabbit@h102 ...
Error: unable to connect to node rabbit@h102: nodedown
DIAGNOSTICS
===========
attempted to contact: [rabbit@h102]
rabbit@h102:
* connected to epmd (port 4369) on h102
* epmd reports: node 'rabbit' not running at all
no other nodes on h102
* suggestion: start the node
current node details:
- node name: 'rabbitmq-cli-5175@h102'
- home dir: /var/lib/rabbitmq
- cookie hash: N3kEGl2Jm7amHtg0ViAg8w==
[root@h102 rabbitmq]#
This command instructs the RabbitMQ node to terminate.