RabbitMq相关运维
Posted littlehb
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了RabbitMq相关运维相关的知识,希望对你有一定的参考价值。
# 命令查询所有用户列表
rabbitmqctl list_users
# 使用命令对 xiandian-admin 用户进行授权
set_permissions xiandian-admin ‘.*‘ ‘.*‘ ‘.*‘
# 查看队列信息,所包含的信息包括 name,arguments, messages,memory,将操作命令和返回结果以文本形式提交到答题框。
rabbitmqctl list_queues
#单节点MQ状态
rabbitmqctl status
[{total,169730360},
{connection_readers,504592},
{connection_writers,25608},
{connection_channels,359456},
{connection_other,1317920},
{queue_procs,64771056},
{queue_slave_procs,0},
{plugins,5609496},
{other_proc,25624816},
{mnesia,105584},
{metrics,423720},
{mgmt_db,2129968},
{msg_index,5115496},
{other_ets,2766648},
{binary,7370464},
{code,24542395},
{atom,1033401},
{other_system,28450628}]
1.定位 linux 系统内存占用最高进程
(1)输入 top 指令
然后输入大写的 M(Shift+m),基于内存占用倒序,找到占用最大内存的进程,如果内存占用最大的为 beam.smp 则为 RabbitMQ 进程占用。
# 查看相应端口占用
netstat -lnutp |grep 15672
# rabbitmqctl status
{alarms,[]},
{listeners,[{clustering,25672,"::"},{amqp,5672,"::"},{http,15672,"::"}]},
{vm_memory_high_watermark,0.4},
{vm_memory_limit,6742941696},
{disk_free_limit,50000000},
{disk_free,27445518336},
{file_descriptors,
[{total_limit,65435},
{total_used,37},
{sockets_limit,58889},
{sockets_used,18}]},
{processes,[{limit,1048576},{used,591}]},
{run_queue,0},
{uptime,1916528},
{kernel,{net_ticktime,60}}]
修改RabbitMQ最大连接数
# https://blog.51cto.com/3646344/2162940
RabbitMQ读写消息的Java Demo
/**生产者:发送成功后一定要关闭 connection,才不会产生临时队列,临时队列就是,如:amq.gen-7Z5nxW9MqSHllIS2QI6diQ
* 消费者:消费成成功后只要关闭channel
*
* **/;
https://blog.csdn.net/yzh_1346983557/article/details/81204901
以上是关于RabbitMq相关运维的主要内容,如果未能解决你的问题,请参考以下文章
openstack详解——openstack rabbitmq安装与启动