Skip to content

Instantly share code, notes, and snippets.

View igreenfield's full-sized avatar

Izek Greenfield igreenfield

View GitHub Profile
@igreenfield
igreenfield / rebalance_rabbitmq.py
Last active July 12, 2017 09:30
Script to rebalance master node for rabbitmq cluster
import httplib
import json
from string import Template
import time
request_template = '{"vhost": "/","name": "$name","pattern": "$pattern","apply-to": "all","definition": {"ha-mode": "nodes","ha-params": ["$node_name"],"ha-sync-mode": "automatic", "queue-master-locator": "min-masters"},"priority": 10}'
post_headers = {"Content-type": "application/json",