Skip to content

Instantly share code, notes, and snippets.

View brentley's full-sized avatar

Brent Langston brentley

View GitHub Profile
@brentley
brentley / rebalance-random-partitioner.sh
Last active February 21, 2017 16:56 — forked from kintarowins/rebalance.sh
Cassandra node rebalancing script
#!/bin/bash
#set -eu
#this looks up the nodes from the ring and rebalances them automatically
# We expect exactly 3 racks (currently)
ip_16="$(hostname -i |cut -f1,2 -d.)"
racks=($(nodetool ring |grep $ip_16 |awk '{print $2}' |sort -u))
rack_0=($(/usr/bin/nodetool ring |grep ${racks[0]} |awk '{print $1}' | sort -n))
#!/usr/bin/env python
import os
import re
import sys
import ansible.errors
import ansible.utils.template
import ansiblelint
import ansiblelint.utils
import jinja2
require 'rubygems'
require 'sinatra'
require 'net-ldap'
require 'digest/sha1'
require 'base64'
require 'haml'
LDAP_HOST = 'localhost'
ADMIN_DN = 'cn=admin,dc=company,dc=com'