Last active
August 29, 2015 14:07
-
-
Save mpenick/5b6536d252d3ce6f1195 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
CLUSTER_NAME=oom | |
NUM_NODES=10 | |
LOW_MEM_NODES=5 | |
RF=3 | |
function prepend { | |
cat $1 | pbcopy && echo -e "$2" > $1 && pbpaste >> $1 | |
} | |
#ccm stop | |
killall -9 java | |
ccm remove ${CLUSTER_NAME} | |
ccm create ${CLUSTER_NAME} -n ${NUM_NODES}:0 -i 127.0.0. -b -v 1.2.15 | |
for i in `seq 1 ${NUM_NODES}`; do | |
sudo ifconfig lo0 alias 127.0.0.$i up | |
done | |
c=0 | |
for f in ~/.ccm/${CLUSTER_NAME}/node*; do | |
c=$[$c + 1] | |
prepend $f/conf/cassandra-env.sh "MAX_HEAP_SIZE=\"20M\"\nHEAP_NEWSIZE=\"10M\"\n" | |
sed -i '' 's/flush_largest_memtables_at: 0.75/flush_largest_memtables_at: 0.99/g' $f/conf/cassandra.yaml | |
echo $f | |
if [ $c -eq ${LOW_MEM_NODES} ]; then | |
break | |
fi | |
done | |
ccm start | |
echo | |
echo "CREATE KEYSPACE examples WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : ${RF} };" | ccm node1 cqlsh | |
echo "CREATE TABLE examples.songs ( id uuid PRIMARY KEY, title text, album text, artist text, tags set<text>, data blob );" | ccm node1 cqlsh | |
echo "DESCRIBE KEYSPACE examples" | ccm node1 cqlsh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment