Skip to content

Instantly share code, notes, and snippets.

@bdeggleston bdeggleston/8070.sh Secret
Created Jan 28, 2016

Embed
What would you like to do?
#!/usr/bin/env bash
ccm create 8070
rm -rf data/hints
echo "creating cluster"
ccm populate -n 2
echo
echo "starting cluster"
ccm start
echo
echo "creating tables"
ccm node1 cqlsh -x "CREATE KEYSPACE ks WITH REPLICATION={'class': 'SimpleStrategy', 'replication_factor':2}"
ccm node1 cqlsh -x "CREATE TABLE ks.tbl (k int primary key, v int)"
echo
echo "stopping node 0"
ccm node1 stop --not-gently
echo
echo "inserting data"
ccm node2 cqlsh -x "INSERT INTO ks.tbl (k, v) VALUES (0, 0)"
ccm node2 cqlsh -x "INSERT INTO ks.tbl (k, v) VALUES (1, 1)"
ccm node2 cqlsh -x "INSERT INTO ks.tbl (k, v) VALUES (2, 2)"
echo "hint files" `ls ~/.ccm/8070/node2/data/hints`
echo
echo "restarting node 1"
ccm node1 start &
tail -f ~/.ccm/8070/node2/logs/system.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.