rabbitmq 常用命令,启停 启停插件(亲测!亲测!亲测!)

版本查询 rabbitmqctl version

[root@hxtomcat1 ~]# rabbitmqctl version
3.8.12

启用Web控制台 rabbitmq-plugins enable rabbitmq_management

[root@hxtomcat1 ~]# rabbitmq-plugins enable rabbitmq_management
Enabling plugins on node rabbit@hxtomcat1:
rabbitmq_management
The following plugins have been configured:
  rabbitmq_management
  rabbitmq_management_agent
  rabbitmq_mqtt
  rabbitmq_web_dispatch
  rabbitmq_web_mqtt
Applying plugin configuration to rabbit@hxtomcat1...
Plugin configuration unchanged.

启动服务 systemctl start rabbitmq-server.service

[root@hxtomcat1 ~]# systemctl start rabbitmq-server.service
[root@hxtomcat1 ~]# 

停止服务 rabbitmqctl stop

[root@hxtomcat1 ~]# rabbitmqctl stop
Stopping and halting node rabbit@hxtomcat1 ...

启动某个插件 rabbitmq-plugins enable XXX

例如:启动mqtt 插件

[root@hxtomcat1 ~]# rabbitmq-plugins enable rabbitmq_mqtt
Enabling plugins on node rabbit@hxtomcat1:
rabbitmq_mqtt
The following plugins have been configured:
  rabbitmq_management
  rabbitmq_management_agent
  rabbitmq_mqtt
  rabbitmq_web_dispatch
Applying plugin configuration to rabbit@hxtomcat1...
The following plugins have been enabled:
  rabbitmq_mqtt

started 1 plugins.
[root@hxtomcat1 ~]# rabbitmq-plugins enable rabbitmq_web_mqtt
Enabling plugins on node rabbit@hxtomcat1:
rabbitmq_web_mqtt
The following plugins have been configured:
  rabbitmq_management
  rabbitmq_management_agent
  rabbitmq_mqtt
  rabbitmq_web_dispatch
  rabbitmq_web_mqtt
Applying plugin configuration to rabbit@hxtomcat1...
The following plugins have been enabled:
  rabbitmq_web_mqtt

started 1 plugins.

停用某个插件 rabbitmq-plugins disable XXX

例如:停止 mqtt插件,他会把rabbitmq_mqtt 和rabbitmq_web_mqtt都停掉。

[root@hxtomcat1 ~]# rabbitmq-plugins disable rabbitmq_mqtt
Disabling plugins on node rabbit@hxtomcat1:
rabbitmq_mqtt
The following plugins have been configured:
  rabbitmq_management
  rabbitmq_management_agent
  rabbitmq_web_dispatch
Applying plugin configuration to rabbit@hxtomcat1...
The following plugins have been disabled:
  rabbitmq_mqtt
  rabbitmq_web_mqtt

stopped 2 plugins.

如果发现web页面,Listening ports里面插件还在,这时重启一下服务就可以了!!!

你可能感兴趣的:(rabbitMQ,rabbitmq,分布式)