Exploring Cluster Topology with Cassandra Shell

Learn to access cluster topology by querying the local and peers tables in the system keyspace using cqlsh.

As the course progresses, we will use the CQL shell to create tables and run queries, etc. For now, let’s explore how Cassandra stores cluster information and query it through cqlsh.

Cluster topology through cqlsh

Cassandra maintains tables in the System keyspace to hold cluster configuration details. As previously stated, nodes of a Cassandra cluster periodically gossip information about themselves and a subset of their peers to other nodes.

The system.local table

Each node maintains information about itself in the system.local table including:

  • A host_id which uniquely identifies the node

  • Node’s cluster_name, data_center and rack 

  • Node’s bootstrapped status

  • Address and port for listening, rpc, and broadcast

  • Versions of cql, native protocol, and Cassandra’s installation

  • A gossip_generation number, i.e., a timestamp that is increased when the node is restarted or its allocated tokens are changed. This signals to other nodes that synchronization is required.

  • Node’s partitioner, and schema version

  • Tokens allocated to the node

To query the system.local table, the following commands can be issued at cqlsh

Get hands-on with 1300+ tech skills courses.