Skip to content

Instantly share code, notes, and snippets.

@debloper
Last active May 18, 2020 21:03
Show Gist options
  • Save debloper/b48c9557925048e394565e650015191c to your computer and use it in GitHub Desktop.
Save debloper/b48c9557925048e394565e650015191c to your computer and use it in GitHub Desktop.
Initialize a simple cassandra cluster
$ cqlsh
Connected to Test Cluster at 127.0.0.1:9042.
[cqlsh 5.0.1 | Cassandra 3.11.6 | CQL spec 3.4.4 | Native protocol v4]
Use HELP for help.
cqlsh> CREATE KEYSPACE foo WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1};
cqlsh> USE foo;
cqlsh:foo> CREATE TABLE foo.bar (id int PRIMARY KEY, status text, details list<text>);
cqlsh:foo> INSERT INTO bar (id, status, details) VALUES (1, 'done', ['sample text']);
cqlsh:foo> SELECT * from bar;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment