How to know the size of a keyspace and column family in Cassandra?

前端 未结 4 1347
情话喂你
情话喂你 2021-02-05 10:21

Recently I\'ve started working on Grails integration with Cassandra using the Java driver for cassandra(cassandra-driver-core-2.0.2). So I was curious to know how we can find ou

4条回答
  •  南方客
    南方客 (楼主)
    2021-02-05 11:06

    I've created a small script to print nodetool results in a nice table:

    #!/bin/sh
    nodetool cfstats -H | awk -F ' *: *' '
      BEGIN { print "Keyspace,Table,Live,Total" }
      /^Keyspace : / { ks = $2 }
      /\tTable:/ { t = $2 }
      /\tSpace used .live/ { sp = $2 }
      /\tSpace used .total/ { print ks "," t "," sp "," $2 }
    ' | column -s , -t
    

提交回复
热议问题