Skip to content

Instantly share code, notes, and snippets.

@bdeggleston
Created January 28, 2016 16:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bdeggleston/13fbb9e70c0c0bd277c7 to your computer and use it in GitHub Desktop.
Save bdeggleston/13fbb9e70c0c0bd277c7 to your computer and use it in GitHub Desktop.
#!/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