Skip to content

Instantly share code, notes, and snippets.

@kintarowins
kintarowins / rebalance.sh
Created August 22, 2012 23:07 — forked from gjcourt/rebalance.sh
Cassandra node rebalancing script
#!/bin/sh
#this looks up the nodes from the ring and rebalances them automatically
hosts = `/usr/bin/nodetool ring |grep Normal |awk '{print $1}' |xargs echo`
RING_SIZE=$(echo "2^127" | bc)
HOST_NUM=$(echo $hosts | wc -w)
INDEX=0