0

I need to provide similar utility functions such as is available through

nodetool tablestats

I've gone over their source code but didn't find a convenient solution to accessing it through code.

Is there a library available for this?

https://github.com/mariusae/cassandra/blob/master/src/java/org/apache/cassandra/tools/NodeProbe.java

Avba
  • 14,822
  • 20
  • 92
  • 192

1 Answers1

1

The nodetool utility is connecting Cassandra via JMX and fetch all necessary data from corresponding beans. You can fetch necessary data from your program via JMX as well, but I wouldn't say that this is recommended way to do - it's better to setup some "standard" monitoring solution, like, Prometheus, connect it to Cassandra, and fetch data via it...

Alex Ott
  • 80,552
  • 8
  • 87
  • 132
  • I want to run various nodetool utility methods like "nodetool repair" and "nodetool tablestats" which isn't a good candidate to expose through prometheous. We are indeed today using prometheus to get the various performance metrics. So regarding the utilities, do you have a good idea how to do it? – Avba Aug 06 '18 at 06:38
  • As I wrote, nodetool is using JMX - you can use it as well if you need... – Alex Ott Aug 06 '18 at 06:46
  • do you know of any wrapper for it? Seems like a lot of work to re-implement it – Avba Aug 06 '18 at 08:16
  • I don't know existing - you can of course try to reuse Cassandra's code, but it's still a lot of work... – Alex Ott Aug 06 '18 at 09:11
  • @AvnerBarr Any jmx client (e.g. JConsole https://docs.oracle.com/javase/8/docs/technotes/guides/management/jconsole.html or VisualVM https://visualvm.github.io/) allows you to call jmx beans methods – Mikhail Baksheev Aug 06 '18 at 10:02
  • For Scylla, you can use the REST API (Swagger interface in http://localhost:10000/ui/ – Avi Kivity Aug 07 '18 at 06:25