RabbitMQ 发布包中默认包含了 Shovel 插件,可以执行 rabbitmq-plugins enable rabbitmq_shovel 命令开启 Shovel 功能,命令如下:
[root@node1 ~]# rabbitmq-plugins enable rabbitmq_shovel Enabling plugins on node rabbit@node1: rabbitmq_shovel The following plugins have been configured: rabbitmq_federation rabbitmq_federation_management rabbitmq_management rabbitmq_management_agent rabbitmq_shovel rabbitmq_web_dispatch Applying plugin configuration to rabbit@node1... The following plugins have been enabled: rabbitmq_shovel started 1 plugins.
Shovel 插件内部也是基于 AMQP 协议转发数据的,所以在开启 rabbitmq_shovel 插件的时候,默认也会开启 amqp_client 插件。
同时,如果要开启 Shovel 的管理插件,需要执行 rabbitmq-plugins enable rabbitmq_shovel_management 命令安装 rabbitmq_shovel_management 插件。命令如下:
[root@node1 ~]# rabbitmq-plugins enable rabbitmq_shovel_management Enabling plugins on node rabbit@node1: rabbitmq_shovel_management The following plugins have been configured: rabbitmq_federation rabbitmq_federation_management rabbitmq_management rabbitmq_management_agent rabbitmq_shovel rabbitmq_shovel_management rabbitmq_web_dispatch Applying plugin configuration to rabbit@node1... The following plugins have been enabled: rabbitmq_shovel_management started 1 plugins.
成功开启 rabbitmq_shovel_management 插件之后,在 RabbitMQ 的管理界面中 “Admin” 的右侧会多出 “Shovel Status” 和 “Shovel Management” 两个 Tab 页,如下图:
如果你能成功看见上图中的 “Shovel Status” 和 “Shovel Management”,那么 Shovel 插件就安装成功了,下一章节将介绍怎样使用 Shovel 插件。