Last active
September 4, 2015 15:21
-
-
Save aboudreault/66fb352a4d5f5382c18e to your computer and use it in GitHub Desktop.
This file contains 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
Cluster: 'local' | |
---------------- | |
node1: UP | |
node3: DOWN | |
node2: UP | |
Cluster: 'local' | |
---------------- | |
node1: DOWN | |
node3: DOWN | |
node2: DOWN | |
Cluster: 'local' | |
---------------- | |
node1: DOWN | |
node3: UP | |
node2: DOWN | |
pk | value | |
----+------- | |
5 | 5 | |
1 | 1 | |
2 | 2 | |
4 | 4 | |
7 | 7 | |
6 | 6 | |
3 | 3 | |
(7 rows) |
This file contains 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 | |
ccm stop | |
ccm remove | |
ccm create --install-dir=/home/aboudreault/git/cstar/cassandra/ -n 3 local | |
ccm start | |
cat << EOF | ccm node1 cqlsh | |
CREATE KEYSPACE test WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 3} ; | |
CREATE TABLE test.test (pk int primary key, value int); | |
insert INTO test.test (pk, value) values (1, 1); | |
insert INTO test.test (pk, value) values (2, 2); | |
insert INTO test.test (pk, value) values (3, 3); | |
insert INTO test.test (pk, value) values (4, 4); | |
insert INTO test.test (pk, value) values (5, 5); | |
EOF | |
sleep 5 | |
ccm node3 stop | |
sleep 10 | |
ccm status | |
cat << EOF | ccm node1 cqlsh | |
insert INTO test.test (pk, value) values (6, 6); | |
insert INTO test.test (pk, value) values (7, 7); | |
EOF | |
sleep 5 | |
ccm node1 stop | |
ccm node2 stop | |
sleep 20 | |
ccm status | |
ccm node3 start | |
sleep 20 | |
ccm status | |
cat << EOF | ccm node3 cqlsh | |
select * from test.test; | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment