597 字
3 分钟

Using RabbitMQ: rabbitmq-plugins

2023-04-07

rabbitmq-plugins#

rabbitmq-plugins is the command-line tool for managing RabbitMQ broker plugins.

Syntax##

Terminal window
rabbitmq-plugins [-n node] {command} [command options ...]

Description##

rabbitmq-plugins is used to enable, disable, and browse plugins. These operations must be performed by a user who has write permissions to the RabbitMQ configuration directory.

Some plugins depend on other plugins to work correctly. rabbitmq-plugins walks these dependency relationships and enables all required plugins. Plugins that you specify explicitly on the rabbitmq-plugins command line are marked as explicitly enabled; dependency plugins are marked as implicitly enabled. Implicitly enabled plugins will be automatically disabled when they are no longer needed.

The enable, disable, and set commands update the plugins file and then attempt to connect to the broker to ensure it is running all enabled plugins. By default, if the tool cannot connect to a running broker (for example, if it has been stopped), a warning is displayed. Use —online or —offline to change this behavior.

Commands##

Terminal window
list [-v] [-m] [-E] [-e] [pattern]
-v Show detailed information for all plugins (verbose)
-m Show only plugin names (minimal)
-E Show only explicitly enabled plugins
-e Show explicitly and implicitly enabled plugins

pattern is a pattern used to filter plugin names.
This command shows all plugins, their versions, dependencies, and descriptions. Each plugin line is prefixed by two status indicators enclosed in []. The first indicator is "" (empty) if the plugin is not enabled; “E” if the plugin is explicitly enabled; “e” if the plugin is implicitly enabled; or ”!” if the plugin is enabled but missing, and therefore cannot run.
The second indicator is "" (empty) if the plugin is not running; "*" if it is running. If an optional pattern is provided, only plugins whose names match the pattern are displayed.

Terminal window
rabbitmq-plugins list
# List all plugins, one per line
rabbitmq-plugins list -v
# List all plugins, including version and description
rabbitmq-plugins list -v management
# List all plugins whose names contain "management"
rabbitmq-plugins list -e rabbit
# List all explicitly or implicitly enabled plugins
Terminal window
rabbitmq-plugins enable [--offline] [--online] {plugin ...}
# --offline Only modify the enabled-plugins file
# --online Treat failure to connect to a running broker as a fatal error
# plugin One or more plugins to be enabled
# This command enables the specified plugins and all of their dependencies
Terminal window
rabbitmq-plugins disable [--offline] [--online] {plugin ...}
# --offline Only modify the enabled-plugins file
# --online Treat failure to connect to a running broker as a fatal error
# plugin One or more plugins to be disabled
# This command disables the specified plugins and all plugins that depend on them
Terminal window
rabbitmq-plugin set [--offline] [--online] {plugin ...}
# --offline Only modify the enabled-plugins file
# --online Treat failure to connect to a running broker as a fatal error
# plugin Zero or more plugins to be enabled
# This command enables the specified plugins and their dependencies. Unlike rabbitmq-plugins enable, it ignores and overrides any already enabled plugins.
# Calling rabbitmq-plugins set with no plugin arguments is valid and means "disable all plugins".
# rabbitmq-plugins set rabbitmq_management
# The command above enables the management plugin and disables all other plugins.

Usage##

Run rabbitmq-plugins enable rabbitmq_management to enable the rabbitmq_management plugin so you can check the cluster status via the web UI. Note the following points:

If you access RabbitMQ via localhost:15672, you can log in with the guest account to view server information. However, by default the guest account has full permissions and is also the default account. For security reasons, the guest user is only allowed to log in from localhost. It is best to change the guest account password and create a new account to manage and monitor the RabbitMQ server.

Using RabbitMQ: rabbitmq-plugins
https://catcat.blog/en/rabbitmq-use-rabbitmq-plugins.html
作者
猫猫博客
发布于
2023-04-07
许可协议
CC BY-NC-SA 4.0