操作前需要先下载rabbitmqadmin工具
rabbitmqadmin工具依赖rabbitmq_management插件
安装rabbitmq_management插件
rabbitmq-plugins enable rabbitmq_management
下载工具
http://{hostname}:15672/cli/rabbitmqadmin
http://{hostname}:15672/cli/rabbitmqadmin]
类似UNIX的操作系统用户需要将Rabbitmqadmin复制到PATH中的目录,例如/usr/local/bin
Windows用户将需要确保Python在其PATH上,并将rabbitmqadmin调用 为python.exe rabbitmqadmin
导出配置
rabbitmqadmin --username USERNAME --password PASSWORD --vhost VHOST export rabbit.definitions.json
导入配置
rabbitmqadmin --username USERNAME --password PASSWORD --vhost VHOST -q import rabbit.definitions.json
Docker下命令
docker exec CONTAINER_NAME --username USERNAME --password PASSWORD --vhost VHOST export rabbit.definitions.json
docker exec CONTAINER_NAME rabbitmqadmin --username USERNAME --password PASSWORD --vhost VHOST -q import rabbit.definitions.json
参考链接
Management Command Line Tool Management Command Line Tool — RabbitMQ