I\'d like to define mirroring for all my queues by default. I currently have to use rabbitmqctl once the node is up:
rabbit
Yes, You can load policies, queues, exchanges, bindings, users and much more directly on restart using definition import at load time.
Go to http://localhost:15672
Admin -> Policies page and create a new policy you need:
You may also preconfigure queues and other things.
curl -s -H "Accept:application/json" -u guest:guest http://localhost:15672/api/definitions > definitions.json
You can also dump your definitions using web interface. Open Overview tab, scroll down:
(!!!) Alter definitions.json
, so as to keep things you need on restart only.
There will be section withing your policies, keep it:
...
"policies": [
{
"vhost": "/",
"name": "ha-all",
"pattern": "",
"apply-to": "all",
"definition": {
"ha-mode": "all"
},
"priority": 0
}
]
...
Put that definitions.json
nearby your rabbit and add this line to rabbit.conf
. No need to use old format:
management.load_definitions = /path/to/definitions.json
So as to load something after restart use cli tools.
Paying tribute to @IvanD since my answer is pretty much the same as his own but reveals detailed steps and new config format usage. Not enough space in comment.