May 26, 2020 Cassandra Cheat sheet

Logging into CQLSH

remote host

export CQLSH_HOST=<rpc address>
export CQLSH_PORT=9042
cqlsh -u cassandra
Password:
cqlsh> exit

from localhost

cqlsh localhost
cqlsh> exit

show info about cluster

cqlsh> DESCRIBE cluster;

show list of keyspaces

cqlsh> DESCRIBE keyspaces;

use keyspacename and show available tables

cqlsh> use keyspacename;
cqlsh:keyspacename> describe tables;

show details about tablename structure

cqlsh:keyspacename>describe tablename;

get details about query execution

cqlsh> TRACING ON;
cqlsh>//run cql query here
cqlsh> TRACING OFF;

Full CQL reference https://cassandra.apache.org/doc/latest/cql/index.html

Databases