Cluster information

Querying system tables to get cluster topology information.

You can query system tables to get cluster topology information. You can get the IP address of peer nodes, data center and rack names, token values, and other information. "The Data Dictionary" article describes querying system tables in detail.

Procedure

After setting up a 3-node cluster using ccm on the Mac OSX, query the peers and local tables.
USE system;
SELECT * FROM peers;
Output from querying the peers table looks something like this.
   peer    | data_center | rack  | release_version | ring_id         | rpc_address | schema_version   | tokens
-----------+-------------+-------+-----------------+-----------------+-------------+------------------+-------. . .
 127.0.0.3 | datacenter1 | rack1 | 1.2.0-beta2     | 53d171bc-ff. . .| 127.0.0.3   | 59adb24e-f3 . . .|  {3074. . .
 127.0.0.2 | datacenter1 | rack1 | 1.2.0-beta2     | 3d19cd8f-c9. . .| 127.0.0.2   | 59adb24e-f3 . . .| {-3074. . .}